shell script input parameter 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: get additional parameters linux scripting
$ cat myscript
#!/bin/bash
echo "First arg: $1"
echo "Second arg: $2"
$ ./myscript hello world
First arg: hello
Second arg: world