I writing a bash script to do a curl with custom headers. The request looks like
curl --location --request GET 'http://100.200.159.79:80/n_clone/' \
--header 'Authorization: Bearer 5e0333f03d311b646f84424a047abef08433d9ed' \
--header 'Content-Type: multipart/form-data; boundary=--------------------------905029954124550761104092'
I want to add a variable after Bearer like
access_token= "5e0af6333f03b646f84424a047abef08433d9ed77411b4f4"
auth_head= "'Authorization: Bearer'$access_to"
get_data=$(curl --location --request GET "http://100.200.159.79:80/n_clone/" \
-H "Authorization: Bearer $access_token" \
-H "Content-Type: multipart/form-data; boundary=--------------------------651618584466976849992097")
I have also tried
get_data=$(curl --location --request GET 'http://100.200.159.79:80/n_clone/' \
-H 'Authorization: Bearer '$access_token \
-H 'Content-Type: multipart/form-data; boundary=--------------------------651618584466976849992097')
How can I insert a variable between ''
(single quotes) such that the curl request works fine? At this time it throws an error of Authorization field missing.