| Author |
shell and subshell
|
|
| Bernie 2002-01-30, 8:20 am |
| I'm taking a class on Red Hat7.2 and the teach was discussing the diff shells. He then mentioned you can use a subshell and this subshell can be diff from the original shell. Ex) the shell is bash and you want to use sh for a subshell. My question is why would you use a subshell and why would want to use a diff shell from the original? | |
|
| u use a subshell anytime u run a shell script. the subshell alows you to change the running enviroment as necessary. | |
| Bernie 2002-01-30, 1:32 pm |
|
sorry, i'm kinda new to the Linux/Unix thing. can you run a script on the first shell? | |
|
| you can use the shell to write scripts that will run in a subshell. for example, put the following in a script called 'script01':
/bin/sh
date
ls -lai
then use the chmod u+x script01 command to make it executable. then when you type ./script01 it will spawn a subshell and execute the script. | |
| onoski 2002-02-08, 4:09 am |
| I'd advice you to get a book on Linux/Unix commands such "Unix in a nutshell" or "Linux in a nutshell". Cheerio and happy learning. |
|
|
|