I am trying to read the value from a file and use it in a curl command as follows:
file.sh
val=$(cat /root/file.txt)
curl -k --location --request GET 'https:MYENDPOINTHERE' --header "Authorization: $val"
when I do echo $val i get "some value" With the quotes. I think there is the issue. Hence, I think the way I am storing the value post a curl command and jq is either wrong or I need to read the value differently
The above call doesn't work. However, if I hard-code the value, it works
val="some value"
curl -k --location --request GET 'https:MYENDPOINTHERE' --header "Authorization: ${val}"
Can someone please suggest what was wrong?