The file setup.sh has mode rwxr-xr-x and contains these lines:
#!/bin/bash cd /tmp/build PROJECT=alpha
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:
./setup.sh pwd echo "Project: $PROJECT"
What do the last two commands print?
It prints /home/kai, then Project: alpha.
It prints /home/kai, then Project: with nothing after it.
It prints /tmp/build, then Project: with nothing after it.
It prints /tmp/build, then Project: alpha.
Unlock full course notes by signing up
What happens when you run ./report.sh
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.