Please hope me with a bash scripting problem. Involves: command substitution and word splitting.
In my script I'm trying to wrap the curl command to give it a global retry value. So I have this
When I call it like this, things seem to work:
But I have one place where I want to call it like this:
LOCAL_CURLOPTS="--time-cond \"Tue, 11 Aug 2009 18:12:12 -0500\""
retry_curl $LOCAL_CURLOPTS "http://example.org/file1.txt
And what I get on the console is:
curl: option -0500: is unknown
curl: try 'curl --help' or 'curl --manual' for more information
So somewhere bash is breaking apart my LOCAL_CURLOPTS as words, and then using that in the command substitution. What I can't figure out is how to get it to stop.