cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: [MAY BE SPAM] Re: Ftping a file and renaming the file at the remote server

From: Dan Fandrich <dan_at_coneharvesters.com>
Date: Mon, 11 Jul 2005 15:45:08 -0700

On Mon, Jul 11, 2005 at 06:05:35PM -0400, VeeraraghJ_at_usa.redcross.org wrote:
> Hi I have been able to rename a file in the remote server> Thank you!
> However I had this problem
> If I had
> new_file =`date '+%H%S'`$file
> curl --insecure --verbose --disable-epsv -B -Q "-RNFR $file" -Q "-RNTO
> $new_file" --ftp-ssl -T $WORKDIR$file -u $USERID:$PASSWD $FSECURELOC
>
> The value for $new_file was not being translated ..I got the error that the
> paramenter for RNTO was not given.
>
> However if I gave the same as
> curl --insecure --verbose --disable-epsv -B -Q "-RNFR $file" -Q "-RNTO `date
> '+%H%S'`$file" --ftp-ssl -T $WORKDIR$file -u $USERID:$
> PASSWD $FSECURELOC
>
> Is there any spefic reason why I could not use a variable in RNTO?? I did not
> have the proble at RNFR.

The variable expansion is being done by the shell, not by curl, so it
failing isn't a curl problem. In the example you gave, you have a space
before and after new_file when setting it. That would cause the Bourne shell
to fail to parse it. Try replacing curl in your command-line with echo to
see how the shell is doing variable replacement.

>>> Dan

-- 
http://www.MoveAnnouncer.com              The web change of address service
          Let webmasters know that your web site has moved
Received on 2005-07-12