A user types ./report.sh at a Bash prompt. The file is executable and begins with the line #!/bin/bash. Put the stages of running the script in the order they happen, from pressing Enter to the status being available to the user.
1.
The new Bash process reads and runs the script's commands one at a time.
2.
The script's last command finishes, and its status becomes the script's exit status.
3.
The interactive shell creates a child process to run the command.
4.
The interactive shell stores the script's exit status in the special parameter $?.
5.
The kernel reads the #! line and starts /bin/bash with the script's path as an argument.
6.
The kernel checks that the file has execute permission for the user.
Unlock full course notes by signing up
Executing versus sourcing a setup script
The file setup.sh has mode rwxr-xr-x and contains these lines:
The directory /tmp/build exists, and the variable PROJECT is not set in the user's terminal. With the working directory /home/kai, the user runs:
What do the last two commands print?