I have a problem on running curl command on shell script. I have a string variable with two dollar sign character, show as below example:
local auth="$3xLxLBcsKv$zY59kBuIpKeG4q1526phJ9"
I need pass this variable to curl command. Like below is my write but not work:
curl --connect-timeout 2 -H 'Extender-Auth: $auth' https://192.168.5.1/1/
But the writing is wrong on shell script. Can someone help me how to modify the writing make it work on shell script?
Thank for your help!
Make curl can work with above option and value.
With double quote - bash will try to perform variable substitution in the enclosed string:
Will try to expand "$3", and "$zY59kBuIpKeG4q1526phJ". Most likely second is empty, and first may be anything.
Try using the single quote, which does not perform substitution: