From: Robert Gustavsson Date: 2001-01-06T04:37:06+09:00 Subject: [ruby-talk:8706] RE: Trouble with %x{} containing quotation marks This is a multi-part message in MIME format. ------=_NextPart_000_0010_01C07757.6E7FC020 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Trouble with %x{} containing quotation marksJoe R Swatosh wrote: >irb(main):002:0> %x{cmd /c "cd && dir *.txt"} > Syntax error: Unterminated quoted string > "" > irb(main):003:0> %x{cmd /c \"cd && dir *.txt\"} > Syntax error: Unterminated quoted string > "" I got the following to parse and run: irb(main):018:0> %x{ "command.com /c \"date\"" } But the return was "" vital statistics: Windows 98 2nd ed. (Yes, I use NT which is superior to 98 at work, I left it downloading RedHat 7.0 though :-) > D:\Code>ruby --version > ruby 1.6.1 (2000-10-05) [i386-cygwin] Same as me. > What obvious thing am I overlooking? Why isn't the output from the date command returned? /rob ------=_NextPart_000_0010_01C07757.6E7FC020 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Trouble with %x{} containing quotation marks
Joe R Swatosh=20 wrote:
 
>irb(main):002:0>=20 %x{cmd /c "cd && dir *.txt"} 
 > Syntax error: Unterminated = quoted=20 string 
 > "" 
 > irb(main):003:0> %x{cmd /c = \"cd=20 && dir *.txt\"} 
 > Syntax error: Unterminated = quoted=20 string 
 > ""
 
I got=20 the following to parse and run:
irb(main):018:0> %x{ "command.com /c \"date\""=20 }
But=20 the return was
""

vital statistics:
Windows  98 = 2nd=20 ed. (Yes, I use NT which is superior to 98 at work, I left it=20 downloading RedHat 7.0 though :-)

 > D:\Code>ruby=20 --version 
 > ruby 1.6.1 (2000-10-05)=20 [i386-cygwin]  

Same as=20 me. 

 > What obvious thing am I=20 overlooking? 
 Why isn't the output from the=20 date command returned?

/rob

------=_NextPart_000_0010_01C07757.6E7FC020--