I have a shell script contains this condition
if [ -z "${PEER_ADDRESS}" ]; then
##some code here
fi
I'm not able to pass PEER_ADDRESS variable when I run the script.
I tried the below but it always executed the if code
./script.sh PEER_ADDRESS="someString"
./script.sh $1 ="someString"
./script.sh "someString"
./script.sh $PEER_ADDRESS="someString"
$1. See stackoverflow.com/questions/9732385, or unix.stackexchange.com/questions/32290 for a key=value notation being handled (it's just string processing; there's no magic "keyword args" function for passing things to Bash).-koption first../script.sh "someString", then"$1"within that script will certainly expand tosomeString, and a question that claims otherwise should include a minimal reproducible example allowing others to see the problem for themselves.