01 / 08
Not being able to choose is inconvenient
The script you made last lesson only ever did the same thing.
#!/bin/shwc -l red.txtThis can only count red.txt. To count another file you would have to rewrite it.
But the commands you type every day are not like that.
wc -l red.txtwc -l blue.txtThey count whatever you write after them. That is the shape you want.
~ $ ./count.sh red.txt3~ $ ./count.sh blue.txt2The words written after are called arguments. Today you learn how to take them.
With this, a script becomes a tool.
a fixed procedure can do one thing onlyone that takes args the same procedure, for all sorts of thingsOne thing to learn, and the places you can use it multiply.