Answers for "pass parameters to shell script"

1

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
Posted by: Guest on June-13-2020
3

run sh with parameter

> ./myscript myargument
myargument becomes $1 inside myscript.
Posted by: Guest on September-04-2020
1

How to Pass Arguments to a Bash Script

makereport -u jsmith -p notebooks -d 10-20-2011 -f pdf

#!/bin/bash
while getopts u:d:p:f: option
do
case "${option}"
in
u) USER=${OPTARG};;
d) DATE=${OPTARG};;
p) PRODUCT=${OPTARG};;
f) FORMAT=${OPTARG};;
esac
done
Posted by: Guest on October-30-2021

Code answers related to "pass parameters to shell script"

Code answers related to "TypeScript"

Browse Popular Code Answers by Language