I am having some problem expanding a variable.
First I set the value of the key.
KEY=Basic YWRtaW46YWRtaW4=
Then I tried calling it in curl but it was not working. To diagnose the problem, I decided to print the actual command that was being run. This was the result
print curl -H `print "Authorization: " $KEY` "http://192.168.1.1/userRpm/WlanMacFilterRpm.htm?Page=1&exclusive=0"
>> http://192.168.1.1/userRpm/WlanMacFilterRpm.htm?Page=1&exclusive=0
It was only printing the string after the KEY. Whereas, If I replaced it myself, it was printing the correct output.
print curl -H "Authorization: Basic YWRtaW46YWRtaW4=" "http://192.168.1.1/userRpm/WlanMacFilterRpm.htm?Page=1&exclusive=0"
>> curl -H Authorization: Basic YWRtaW46YWRtaW4= http://192.168.1.1/userRpm/WlanMacFilterRpm.htm?Page=1&exclusive=0