What is meant by subprocesses?


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers What is meant by subprocesses?
# 1  
Old 03-22-2010
What is meant by subprocesses?

I'm going through my UNIX book and came across a section on Customization and Subprocesses.

Can someone tell me what a subprocess is -- for example, when the book says "Which shell 'thing' are known to subprocesses" what exactly does it mean? The book just talks about it without defining it -- very frustrating, because the following section doesn't make a lot of sense to me.

What is the difference between a bash program and an interactive shell? (I think an interactive shell is one that accepts user input, right?)

Last edited by Straitsfan; 03-22-2010 at 11:21 AM..
# 2  
Old 03-22-2010
A subprocess is a child process, i.e. a process that has been launched by its parent to which it is a subprocess.

An interactive shell is a command line interpreter reading your input line by line and prompting you when a command is done.

A bash program (or more generally a shell script) is reading its commands not from your keyboard but from a text file containing them.
# 3  
Old 03-22-2010
Can you give me an example of a process and a subprocess? I'm still not quite clear -- it's still a little confusing when the word I don't understand the definition of is used in the definition.
# 4  
Old 03-22-2010
Being a subprocess denotes a relationship, not a specific property.
All processes are subprocesses of their parent process, except init which is launched by the kernel itself.
# 5  
Old 03-22-2010
But, with all due respect, that doesn't make it any clearer.

Can you tell me what a process is, and give an example of one, and then explain/give an example, or tell me then what the subprocess would be? I'm just learning about this kind of stuff and it's still confusing. Smilie
# 6  
Old 03-22-2010
Quote from Wikipedia
Quote:
In computing, a process is an instance of a computer program that is being executed. It contains the program code and its current activity. Depending on the operating system (OS), a process may be made up of multiple threads of execution that execute instructions concurrently.

A computer program is a passive collection of instructions, a process is the actual execution of those instructions. Several processes may be associated with the same program; for example, opening up several instances of the same program often means more than one process is being executed.
I can't think of a better explanation, and it would have helped if you stated from the start that you don't know what a process is. We were under the assumption that you're only unclear on the concept of a sub-process.
# 7  
Old 03-22-2010
My apologies -- but your explanation is fine. So I'm guessing that a subprocess consists of other executions required to carry out the primary executions of said instructions?

so when something is 'known' to a subprocess, it means what?

Here are the paragraphs that confused me:

"Some of the variables discussed above are used by commands you may run -- as opposed to the shell itself -- so that they can determine certain aspects of your envrionment. The majority, however, are not even known outside the shell.

This dichotomy begs an important question: which shell "Things" are known outside the shell, and which are only internal? This question is at the heart of many misunderstandings about the shell and shell programming. Before we answer, we'll as it again in a more precise way: which shell "things?" are known to subprocesses? Remember that wenever you enter a command, you are telling the shell to run that commmand in a subprocess; furthermore, some complex programsmay start their own subprocesses. Now for the answer, which (like many UNXI concepts) is unfortunately not as simple as you might like. "A few things are known to subprocesses, but the reverse is not true: subprocesses can never make these things known to the processes that created them.

Which things are know depends on whether the subprocess in question is a bash program or an interactive shell. If the subprocess is a bash program, then it's possible to propagate nearly every type of thing we've seen in this chapter -- options and variables -- plus a few we'll see later."

To which I respond: Huh? Smilie

I ask because the following section i the book concerns what are called environment variables, and if I know what a subprocess is, then I can make sense of the section better.

Maybe I should have just quoted this at the beginning, come to think of it. Apologies again.

Last edited by Straitsfan; 03-22-2010 at 11:33 AM..
 
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Shells, forks, subprocesses... oh my

all, i've been reading to try and get an abstract idea of the process effeciency of commands , sed, bash, perl, awk, find, grep, etc which processes will spawn?, fork?, launch subshell?, etc and under what conditions? how do you know which commands have the faster and better stdio... (2 Replies)
Discussion started by: f77hack
2 Replies

2. UNIX for Dummies Questions & Answers

How to kill a script and all its subprocesses?

I'd like to terminate scripts. These scripts are not by me, but other persons. These contain other programs such as ping, nmap, arp, etc. If such a script is running, how can I terminate this script AND all processes called by this script? These scripts are big so terminating all programs... (4 Replies)
Discussion started by: lordofazeroth
4 Replies

3. UNIX for Dummies Questions & Answers

What is meant by "LDAP Instances"?

What is meant by "LDAP Instances"?any clarification or examples? (2 Replies)
Discussion started by: ahmedamer12
2 Replies

4. UNIX for Dummies Questions & Answers

What is meant by "exit $?"

What is meant by "exit $?" (4 Replies)
Discussion started by: santosh149
4 Replies

5. Post Here to Contact Site Administrators and Moderators

What is meant by the words under usernames?

Under all users, there are some keynames. Some are obvious, like Moderator and Registered User. I have seen others too. What do they mean or signify?;) (2 Replies)
Discussion started by: joeyg
2 Replies

6. UNIX for Dummies Questions & Answers

What is meant by <<! ... ! ??

I tried typing it into google but no results. I don't know what it's called or what it does and when it is used so I must ask: What does it mean if you have something like... cmd <!! cm2 cm3 ! What do those <!! and ! symbols do? When/why do you use them? I found it inside a bourne... (2 Replies)
Discussion started by: yongho
2 Replies

7. UNIX for Dummies Questions & Answers

What is meant by Kernel Parameter "dflssiz" in Digital Unix (OSF)

Hi, We have a Digital Unix Server with OSF. There's a Kernel Parameter "dflssiz" on this server. I just want to know, what it means. Thanks (2 Replies)
Discussion started by: sameerdes
2 Replies

8. UNIX for Advanced & Expert Users

possibility to call subprocesses from ksh ??

Hi!! Is there a possibility to call/start a subproces using ksh ?? Hope that there is somebody to help me. thanks in advance. Corine (3 Replies)
Discussion started by: TheBlueLady
3 Replies

9. Shell Programming and Scripting

Please help me with this script meant for checking /etc/passwd if a name exists

I'm trying to create a program that includes variety of duties. One of the duties includes deleting a user if the user name exist in the /etc/passwd file. how do i make that happen. those of you that know about this shell programming, please tell me what i should do after the shell reads... (4 Replies)
Discussion started by: TRUEST
4 Replies
Login or Register to Ask a Question