Im trying to pass curl a list of arguments... one of which is a date... When I run from the command line it works fine but when i try to run the same from a script passing variables it reformats the date for some reason and doesn't work. Example:
curlstring=xxxxxxxxxxx.xxx.xxx:8090/csv/ $curlstring '--data asOfDate="20110427 12:46 GMT"
curl xxxxxxxxxxx.xxx.xxx:8090/csv/ $curlstring
+ curl xxxxxxxxxxx.xxx.xxx:8090/csv/ $curlstring --data asOfDate='"20110427' 12:46 'GMT"'
It for some reason is putting single quotes into the syntax. Variable is created using the following:
AsofDate=`grep AsofDate $PROPERTIES_DIR/1.properties | cut -c 15-`
The working syntax from command line is:
curl xxxxxxxxxxx.xxx.xxx:8090/csv/ $curlstring --data asOfDate="20110427 12:47 GMT"
So the correct syntax is:
asOfDate="20110427 12:47 GMT"
But the script is passing:
asOfDate='"20110427' 12:46 'GMT"'
Why the extra ' marks ?!?!?!?