0

I have a curl command that looks like this

curl --silent -H 'Authorization:Bearer sdfsdfsfd/1Fdsdfsdfdf' https://example.com/api

Running this command as is via terminal returns the expected results.

I am trying to incorporate this curl command in my bash script as follows:

OPTS_HOST='https://example.com/api'
OPTS_USER='Authorization:Bearer sdfsdfsfd/1Fdsdfsdfdf'
OPTS_CURL="--silent"
CURL_CMD="curl $OPTS_CURL -H"

$CURL_CMD \'$OPTS_USER\' $OPTS_HOST

the output of this seems to be an unexpected HTML error page.

Pretty sure it is something to do with the bearer token interpretation in the command.

Can anyone point me in the right direction here? TIA

pa1
  • 778
  • 3
  • 11
  • 26

0 Answers0