curl-users
Re: More whitespace escaping commandline
Date: Thu, 3 Apr 2014 11:08:23 -0400
On Thu, Apr 3, 2014 at 10:28 AM, Alex Bligh <alex_at_alex.org.uk> wrote:
>
> On 3 Apr 2014, at 15:09, Rasmus Olsen wrote:
>
> > #!/bin/sh
> > CMD="curl -s -f --show-error --ftp-create-dirs -T $1 -u $2:$3 $4"
> > $CMD 2>&1
>
Or perhaps:
#!/bin/sh
CMD="curl -s -f --show-error --ftp-create-dirs -T \"$1\" -u $2:$3 $4"
echo $CMD
#$CMD 2>&1
When I run into these shell syntax problems, I usually start by echoing
back the value of that variable to see precisely what is in it, and comment
out the actual command line execution. Then you should be able to
copy/paste the echoed value and it should run, as a basic test.
-- Leif
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-users
FAQ: http://curl.haxx.se/docs/faq.html
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2014-04-03