Here is a bit of code I am having issues with
id=`my_api myrouter myroutername getsomething'{"uid":"$servername","meta_type":"system"}'| $SCRIPTS_DIR/jq -M '.result.data[].uid'`
for i in `echo $id`;
do
echo $i
echo ""
done
I am not able to pass the variable $servername inside backticks. Hardcoding the servername works absolutly fine
I am using a bash script. Tried escaping but it doesnt work. I know am missing something very trivial but it is not coming across to me.