I'm trying to pass a variable via command line so the variable value gets assigned in the script. I also need to display help options via command when I run test.sh -h
I'm able to do this by using the $1
variable (./test.sh us-east-1
or ./tesh.sh us-west-1
) but it only works with one argurment.
LOWER = us-east-1
HIGHER = us-west-1
username_json=$(aws xxxx xxxx xxxxxxx --query xxxx --output text --region "us-east-1" )
json_token=$(curl -k \
-H "Content-Type: application/json" \
-X POST \
-d \
'{
"username":"'$username'",
"password":"'$password'"
}' \
https://us-east1.xxxxxxx | jq '.token')
I need to run script
./test.sh -e LOWER
===> this should run in lower env with value us-east-1
./test.sh -e HIGHER
==> this should run in higher env with value us-east-1