On Wed, Mar 2, 2011 at 12:06 PM, Xavier NoõÍle <xavier.noelle / gmail.com> wrote: > 2011/3/2 Albert Schlef <albertschlef / gmail.com>: >> Ruby tells the shell to execute the command (that's why you see "sh -c") >> [...] > > Thanks for your explanations, but this is along the lines of what I > already understood. > I mentionned top to explain the problem more directly but I know that > the problem is not due do top; in fact, I already use htop on both > machines and the tree view showed me what I stated in my original > post. > > To be more precise, the output of my script, on my Debian and Gentoo > machines, looks like this: > 6750 > 1 > > These numbers are respectively the PID and parent PID of my process...init ! > > But on my Ubuntu machine, it's something like: > 16055 > 16050 > > The first is the Ruby script's PID and the second is the PID of "sh -c". What Ruby versions are you using? Note that there are some changes between 1.8 and 1.9 in this area, namely that system, IO.popen etc. accept a list of strings which prevents passing the command to a shell. Although I may also be that the shell behaves differently on both systems. Kind regards robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/