I am attempting to run a curl statement that I copied from Chrome DevTools. The statement has a bunch of Header parameters.
If I paste this into a Terminal window, it works great.
If I drop this into a shell script, and run the script, each line is executed as its own statement, ignoring the backslash.
curl 'https://localhost' \
-H 'authority: localhost' \
-H 'accept: application/json, text/plain, */*' \
-H 'accept-language: en-US,en;q=0.9' \
-H 'referer: https://localhost' \
-H 'sec-ch-ua: "Google Chrome";v="107", "Chromium";v="107", "Not=A?Brand";v="24"' \
-H 'sec-ch-ua-mobile: ?0' \
-H 'sec-ch-ua-platform: "macOS"' \
-H 'sec-fetch-dest: empty' \
-H 'sec-fetch-mode: cors' \
-H 'sec-fetch-site: same-origin' \
-H 'user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36' \
--compressed
Do I need to prepend the script with something or invoke it a particular way? I don't do much shell scripting but I'm sure this is an easy one for someone to answer.