Changes

483 bytes added ,  21:12, 22 September 2009
no edit summary
Line 1: Line 1:  +
* Whenever you run a shell script, it creates a new process called subshell.
 +
* A Subshell can be used to do parallel processing.
 +
* If you start another shell on top of your current shell, it can be referred to as a subshell. Type the following command to see subshell value:
 +
<source lang="bash">echo $BASH_SUBSHELL</source>
 +
OR
 +
<source lang="bash">echo "Current shell: $BASH_SUBSHELL"; ( echo "Running du in subshell: $BASH_SUBSHELL" ;cd /tmp; du 2>/tmp/error 1>/tmp/output)</source>
 
==Exporting Functions and Variables==
 
==Exporting Functions and Variables==
 
A subshell does not inherit a variable's setting. Use the [[export command]] to export variables and functions to subshell:
 
A subshell does not inherit a variable's setting. Use the [[export command]] to export variables and functions to subshell: