Personal tools
You are here: Home Docs Help! Reference Manuals Bash Guide for Beginners Bash and Bash scripts Executing commands Executing programs from a script

1.3.3. Executing programs from a script

Up one level

-

When the program being executed is a shell script, bash will create a new bash process using a fork. This subshell reads the lines from the shell script one line at a time. Commands on each line are read, interpreted and executed as if they would have come directly from the keyboard.

While the subshell processes each line of the script, the parent shell waits for its child process to finish. When there are no more lines in the shell script to read, the subshell terminates. The parent shell awakes and displays a new prompt.

(no ads!)