Re: unix shell script ignores 'exit' when in function that is piped to tee

From: CV (or254498_at_hotmail.com)
Date: 01/11/05


Date: Tue, 11 Jan 2005 17:54:24 +0100

Lew Pitcher wrote:
> What you didn't take into account is that the pipe causes the left hand side
> of the command to be executed in a child process, and the stdout of that child
> process is fed into the stdin of the parent process that's running the right
> hand side of the command.

There is still something that I don't understand here.

If there is a child process it should have a different process-id,
right ?

But I tried printing out the pid to a file from within the
child (echo $$>>funpid) and the result was the same pid as
the parent !?

Cheers CV



Relevant Pages

  • Re: IPC
    ... You want to use the system command here ... ... Pid in perl script are different from Pid in bash and so I can't kill them and I can't wait for them. ... 19992 pts/1 00:00:00 example.pl ... 20001 pts/1 00:00:00 sh child process 19993 finished, ...
    (comp.lang.perl.misc)
  • Re: Shared memory and error 997
    ... CreateProcess(...including szName in the command line ... >> CreateFileMappingin the parent process. ... >> command line parameter to the child process. ... >> shared memory using OpenFileMappingit fails and GetLastError() ...
    (microsoft.public.vc.language)
  • Re: Persistent connections
    ... do you get a persistent PHP ... the at command (from an SSH ... HUP to all child process. ... expired - the method described above just changes the parent process ...
    (comp.lang.php)
  • Re: fork and exec PPID question
    ... the child process PID will be unique, but it's PPID will be the PID of ... the parent process PID will be unique, and it's PPID will be the PID of ... an immediate execperformed by the child process. ...
    (comp.unix.questions)
  • Re: IPC
    ... >> This is a nasty command that attempts to fill up your disk with a file ... because the shell process will wait for the command process ... parent shell will NOT wait for the child process to complete. ... child process 22187 finished, closing pipe ...
    (comp.lang.perl.misc)