argument in shell script code example
Example 1: shell script get arguments
$ myscript.sh first_arg second_arg
# myscript.sh
#!/bin/bash
echo $1 # output: first_arg
echo $2 # output: second_arg
Example 2: run sh with parameter
> ./myscript myargument
myargument becomes $1 inside myscript.
Example 3: args in shell
Any argument given after the calling of the script will be called $1, $2, $3 etc..