in reply to Re: pipes: killing the child?
in thread pipes: killing the child?

The IPC::Open docs say:

Since Perl 5.8.0, you can also use the list form of open for pipes : the syntax
open KID_PS, "-|", "ps", "aux" or die $!;

forks the ps(1) command...

I don't understand the terminology "forks the ps(1) command". As far as I know, a fork() copies the current program and runs it in another process. So how can you "fork() a command"? Doesn't fork() always copy the current program rather than run a specified command? Do the IPC docs really mean a fork(), which copies the current program and runs it in a another process, plus an exec() in the child which replaces the current program with the command?

Replies are listed 'Best First'.
Re^3: pipes: killing the child?
by ikegami (Patriarch) on Jan 22, 2010 at 10:32 UTC
    Yes, "forks the ps(1) command" is short for "forks and execs the ps(1) command in the child".
Re^3: pipes: killing the child?
by Anonymous Monk on Jan 22, 2010 at 09:05 UTC
    Yup, the docs do really mean what they say :)