Bash Script Arguments
Arguments can be added to a bash script after the the script’s name. Once provided they can be accessed by using
$(position in the argument list). For example, the first argument can be accessed with
$1, the second with
$2, the third with
Bash script variables
Variables in a bash script can be set using the
= sign, and accessed using
read command can be used to prompt the user for input. It will continue to read user input until the Enter key is pressed.
Some prompt text can also be specified using
-p with the
Aliases can be created using the keyword
alias. They are used to create shorter commands for calling bash scripts. They can also be used to call bash scripts with certain arguments.
Bash script comparison operators
In bash scripting, strings are compared using the
== (Equal) and
!= (Not equal) operators.