Bash scripts can receive inputs via command line arguments. These let you pass data or flags to your script when you run it.
$0
— The script name$1, $2, ...
— Arguments 1, 2, etc.$#
— Number of arguments passed$@
— All arguments as separate words$*
— All arguments as a single stringType some arguments separated by spaces (e.g. hello world 123
) below and see how the script "receives" them:
./script.sh arg1 arg2
to pass arguments to your bash script.