Crash Course in BASH Script Programming (a classic):
How to read command line parameters in BASH Scripts
Shell Scripts (BASH Scripts) can access command line parameters using the the variables $1, $2, $2 and so forth, up to $9. In fact, more parameters can be accessed by using curly brackets, like ${10}, ${187} and so forth. Here’s an example: #!/bin/bash if [[ $1 == “x” ]]; then echo “Statement is true” else … Read more