From: Edward Thornton Date: 2011-05-16T03:04:20+09:00 Subject: [ruby-core:36203] Fwd: Using %X problem --20cf3005e07227ef1904a3545e4b Content-Type: text/plain; charset=ISO-8859-1 ---------- Forwarded message ---------- From: Edward Thornton Date: Sun, May 15, 2011 at 4:48 AM Subject: Using %X problem To: ruby-core@ruby-lang.org I have been having problems with a very simple program. ----------------------------------------- #!/usr/bin/ruby # puts "Begin Test" puts %x{"ps -ef"} puts "End Test" ---------------------------------------- Results on both CENTOS 4.5 and UBUNTU 10.10 are as follows: ----------------------------------------- hydra(KINGSTON}$ruby test.rb Begin Test sh: ps -ef: not found End Test hydra(KINGSTON}$ ----------------------------------------- Now 'ps -ef' works fine at the command line -- But gets this result from Ruby? Oddly, the command "ps" works fine both from Ruby and Command line. I checked the SHELL Logical and it was what I expected: SHELL=/bin/bash Any clue what is going on here?? I thouht it was a OS problem but the same thing happens on two disimilar OS's. Chuck admin@hawthorne-press.com --20cf3005e07227ef1904a3545e4b Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable

---------- Forwarded message ----------<= br>From: Edward Thornton <chair667board@gmail.com>
Date: Sun, May 15, 2011 at 4:48 AM
Subject: Using %X problem
To:
ruby-core@ruby-lang.org

<= br>I have been having problems with a
very simple program. =A0
-----------------------------------------
#!/usr/bin/ruby
#
puts "Begin Test"
puts %x{"ps = -ef"}
puts "End Test"
----------------------------= ------------
Results on both CENTOS 4.5 and
UBUNTU 10.1= 0 are as follows:

--------------------------------= ---------
hydra(KINGSTON}$ruby test.rb
Begin Test
sh: p= s -ef: not found

End Test
hydra(KINGSTON= }$
-----------------------------------------

Now 'ps -ef' works fine at the
command lin= e -- But gets this
result from Ruby?

Odd= ly, the command =A0"ps" works
fine both from Ruby and C= ommand
line.

I checked the SHELL Logical and it
was what I expected:

=A0=A0SHELL=3D/bin/bash=

Any clue what is going on here??

I thouht it was a OS problem but
the same thing happens on t= wo
disimilar OS's.

=A0=A0 Chuck


--20cf3005e07227ef1904a3545e4b--