Answers for "bash get first argument"

8

shell script get arguments

$ myscript.sh first_arg second_arg

# myscript.sh
#!/bin/bash
echo $1 # output: first_arg
echo $2 # output: second_arg
Posted by: Guest on August-07-2020
0

bash get first argument

function_name () {
   echo "Parameter #1 is $1"
}
Posted by: Guest on May-01-2020

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language