I have a script that uses an ID & PW with curl and it works perfectly when I run it locally. When I define $4 as username and $5 as the password (with the respective values in the policy) and run the script in Jamf it just hangs and I can't figure out why.
curl -u username:password https://company.com... works perfectly when run locally. It also works in Jamf, but I'd rather not put the credentials directly in the script.
curl -u $4:$5 https://company.com... does not work when run from Jamf.
I have tried variations like $4 : $5 or "$4" : "$5" or '$4' : '$5' or "$4":"$5" or '$4':'$5'
I've even verified the values with a line that says echo $4 $5 and it does report the values correctly.
However, if I define variables in the script like $acct=username and $pw=password and use $acct:$pw in the curl command, that works just fine, but once again, I'd rather not put the credentials directly in the script. It seems that I can't get the variables to work when defined in Jamf.
What am I missing?