cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: -Q and bash

From: Dan Fandrich <dan_at_coneharvesters.com>
Date: Fri, 19 Dec 2008 22:48:54 -0800

On Fri, Dec 19, 2008 at 07:52:58PM -0800, K Seb wrote:
> I've had some issues using the --quote option with bash. I'd like to send the
> command CWD to change directories on my server but it seems that when using
> bash, curl does not see the argument I'm sending with the command.
>
> ie:
>
> DVR_CWD="curl --trace-ascii \"-\" -ns ftp://192.168.2.104/ --quote \"CWD
> Jul.31.2008\"";
> echo $DVR_CWD > /root/DVRCWD
> $(tail < /root/DVRCWD)

The $() command substitution doesn't do the full shell interpretation of the
argument. Replace the last line with:

 eval $(tail < /root/DVRCWD)

to do what you want.

But on another note, it's not a good idea to put CWD in a quote command
unless absolutely necessary, since it messes up the synchronization between
the server's CWD and curl's internal idea of the CWD. You coudl just as
easily accomplish the same with:

  curl --trace-ascii - -ns ftp://192.168.2.104/Jul.31.2008/

>>> Dan

-- 
http://www.MoveAnnouncer.com              The web change of address service
          Let webmasters know that your web site has moved
-------------------------------------------------------------------
List admin: http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-users
FAQ:        http://curl.haxx.se/docs/faq.html
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2008-12-20