When writing a script in bash you can pass parameters into that script to work with. For example, let’s say I have a script file called
runme.sh and I want to pass in my name and today’s date. I could do that like this.
./runme.sh "Adron Hall" "12/27/2018"
Inside the script I can get access to the parameters by using the bash param variables of $1, $2, and so on. With a little bash code written up like this.
|echo "The first parameter $1"|
|echo "The second parameter is $2"|
|echo "The \$0 parametere returns the name of the file! This file is named $0."|