Writing and running bash scripts

What is a script?

A script is a computer program, basically a file, that contains multiple commands that you want to execute as a whole.

Scripts allow to automate analyses: you can do the same set of commands on each input file that you want to analyze. An additional plus is that you keep track of all the steps that you do to analyze your data.

What is bash?

Remember that when we run commands, we are working in the shell (go to Replit and check the name of the window you are writing the code in). Bash stands for Bourne Again SHell, the shell that is standardly used for interpreting Linux commands.

So a bash script is nothing more than a file that contains commands that can be read, interpreted and executed by bash. Bash will process the script line per line.