sub proces with '

R

Roeland Moors

I'm trying to execute a subproces and get the output:
files = `ls -1 | sed 's/\..*$//' | sort -u`

But it looks like ruby ignores the '
I tried escaping it (\') but that doesn't help.
It's the same with popen.

Is there a solution to this?

(I know I can leave sed away and to that with ruby)
 
T

ts

R> I tried escaping it (\') but that doesn't help.

It's \ that you must escape

files = `ls -1 | sed 's/\\..*$//' | sort -u`



Guy Decoux
 
R

Roeland Moors

R> I tried escaping it (\') but that doesn't help.

It's \ that you must escape

files = `ls -1 | sed 's/\\..*$//' | sort -u`
damn, you're right, what was I thinking..

thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top