Fork and exec

Thanks Nobu, this makes sense.

···

-----Original Message-----
From: nobu.nokada@softhome.net [mailto:nobu.nokada@softhome.net]
Sent: Wednesday, October 16, 2002 10:22 PM
To: ruby-talk@ruby-lang.org
Subject: Re: fork and exec

Hi,

At Thu, 17 Oct 2002 08:26:09 +0900, Meng, Ted mengx@tvratings.com wrote:

system “mkfifo ttt”
pid = fork
exec (“cat < ttt”) if pid.nil?

exec (“exec cat < ttt”) if pid.nil?

I would expect only one process the real “cat process”, but apparently,
ruby
spawned
a process and then a child process, which is the real one.

When you use redirection, ruby invokes /bin/sh and /bin/sh
forks to execute the command.


Nobu Nakada