I am trying to write a script where the user can pass startDate and endDate via arguments when running the script. Here's my script (saved as test.sh)-
VAR="$(curl -f -X POST -H 'X-API-TOKEN: XXXXXX' -H 'Content-Type: application/json' -d '{"format": "csv", "startDate": $1, "endDate": $2}' 'https://xxx.qualtrics.com/export-responses' | sed -E -n 's/.*([^"]+).+/\1/p')"
echo $VAR
When running the script I type the following -
~/test.sh '"2020-05-13T17:11:00Z","2020-05-13T20:32:00Z"'
The script throws an error.