You type the same commands every morning. Put them in a file, and run the file. A file of commands is a script.
learner@tidepool:~$ cat morning.sh
# Show what the shop must know at the start of the day.
date
cat ~/shop/rota.txt
grep -c ERROR ~/logs/till.logEach line is a command, the same as a line that you type at the prompt.
Run it with bash
bash FILE starts a new bash process, which reads the file and runs the lines from top to bottom:
learner@tidepool:~$ bash morning.sh
Mon Oct 12 08:00:00 UTC 2026
mon ana
2The script runs in a child process. A cd or a variable in the script changes only the child, not your shell. You learned this in "Pass a Variable On with export".
Comments
A line that starts with # is a comment. Bash skips it. Write comments to say what the script does and why.
Make a script
Make the file with the editor, nano morning.sh. Many people give scripts the end .sh, so that they are easy to find. Bash does not need it.