Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 06-30-2008, 04:44 PM   #1
LQ Newbie
Registered: Jun 2008
Posts: 4

Rep: Reputation: 0
Which is the parent and child process in given command?

Which is the parent and child process in the following command?

$ ls -l | wc -l


Old 06-30-2008, 06:17 PM   #2
LQ 5k Club
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,396
Blog Entries: 2

Rep: Reputation: 905Reputation: 905Reputation: 905Reputation: 905Reputation: 905Reputation: 905Reputation: 905Reputation: 905
As I understand it, these commands do not exhibit a parent/child relationship. They are both child processes of the shell that launches them. They would be siblings, in that sense. The shell arranges the standard input and output file descriptors of each process, such that the standard output stream from ls is the standard input stream of wc. Pipes between processes does not imply a parent/child relationship, although such may be the case, where a process itself launches a child process, and arranges the same sort of standard IO arrangement as does the shell in your example.

This sounds like a question to settle a bet, no?

--- rod.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
how parent process can control it's child? sluge Linux - General 2 08-02-2007 04:31 AM
child process usses same amount of ram as parent process socialjazz Programming 7 10-19-2006 05:48 PM
Bash Scripting - child process affecting parent process mthaddon Linux - General 1 05-02-2004 01:19 PM
about parent and child process winwar Solaris / OpenSolaris 3 07-23-2003 06:07 AM
child and parent process error jdevanand Programming 1 04-29-2002 08:13 AM

All times are GMT -5. The time now is 09:04 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration