Ok ... thanks for the information
About (2), when you write a command on the command line (CLI) it is processed by the shell (for things likes globs, expansions and so on) and then that information passed to the command you are using.
So using one of your examples:
tr -d [:punct:] < Gasoline;
On the CLI the semi-colon (
at the end is not required unless entering more than one command after each other
The shell will use its own interpretation for anything that is not a command and not quoted, hence entering [
unct:] is potentially dangerous unless you are sure the shell will not interpret it
Once interpretation is completed the information is then passed to the command (tr in your case) and it performs its necessary tasks
Note: You do also have redirection here but as you have used it I will assume you understand what it is doing.
Now if you wanted to enter all of the commands from your first post, your choices are:
1. Enter each command on a single line of the CLI
2. Enter all commands on the CLI separated by a semi-colon
3. Place all command in a file and using an interpreter (in your case bash) to execute the commands in the file. This also has multiple options:
a. Simplest case is to put the commands in the file, we will call script.sh, and execute thusly:
b. Again place the commands in the file and at the top of the file you identify which interpreter (this should have been explained already in your class) to use: (you will also need to make the file executable)
(4) What about commands like sed or awk?