The following bash script is to run an azure command:
#!/bin/bash
RG=$1
echo "az cosmosdb list-keys -g $1 -n db01"
echo "az cosmosdb list-keys -g $RG -n db01"
Then run the script with this command:
cosmokeys.sh main-Resource-Grp
The output is
az cosmosdb list-keys -g main-Resource-Grp -n db01
-n db01sdb list-keys -g main-Resource-Grp
I don't know Unix/Linux, beginner questions are:
How come
$1
and$RG
will yield a different result?How can I fix this so that I can still use
$RG
and yield the first result