cURL / Mailing Lists / curl-users / Single Mail

curl-users

-Q and bash

From: K Seb <k1.seb31_at_gmail.com>
Date: Fri, 19 Dec 2008 19:52:58 -0800

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 response is:

== Info: About to connect() to 192.168.2.104 port 21 (#0)
== Info: Trying 192.168.2.104... == Info: connected
== Info: Connected to 192.168.2.104 (192.168.2.104) port 21 (#0)
<= Recv header, 23 bytes (0x17)
0000: 220 FTP server ready.
=> Send header, 15 bytes (0xf)
0000: USER dvrStart
<= Recv header, 24 bytes (0x18)
0000: 331 Password required.
=> Send header, 15 bytes (0xf)
0000: PASS myPass40
<= Recv header, 25 bytes (0x19)
0000: 231 User name accepted.
=> Send header, 5 bytes (0x5)
0000: PWD
<= Recv header, 9 bytes (0x9)
0000: 257 "/"
== Info: Entry path is '/'
=> Send header, 6 bytes (0x6)
0000: "CWD
<= Recv header, 28 bytes (0x1c)
0000: 510 command not supported.
== Info: QUOT command failed with 510
== Info: Closing connection #0
== Info: Protocol http not supported or disabled in libcurl
~ #

When I simple enter the command from the command line it works:
curl --trace-ascii "-" -n ftp://192.168.2.104/ -Q 'CWD Jul.31.2008'

== Info: About to connect() to 192.168.2.104 port 21 (#0)
== Info: Trying 192.168.2.104... == Info: connected
== Info: Connected to 192.168.2.104 (192.168.2.104) port 21 (#0)
<= Recv header, 23 bytes (0x17)
0000: 220 FTP server ready.
=> Send header, 15 bytes (0xf)
0000: USER dvrStart
<= Recv header, 24 bytes (0x18)
0000: 331 Password required.
=> Send header, 15 bytes (0xf)
0000: PASS myPass40
<= Recv header, 25 bytes (0x19)
0000: 231 User name accepted.
=> Send header, 5 bytes (0x5)
0000: PWD
<= Recv header, 9 bytes (0x9)
0000: 257 "/"
== Info: Entry path is '/'
=> Send header, 17 bytes (0x11)
0000: CWD Jul.31.2008
<= Recv header, 25 bytes (0x19)
0000: 257 command successful.
== Info: Telling server to connect to 192.168.2.104:57672
=> Send header, 27 bytes (0x1b)
0000: PORT 192,168,2,104,225,72
<= Recv header, 9 bytes (0x9)
0000: 200 OK.
== Info: Connect data stream actively
=> Send header, 8 bytes (0x8)
0000: TYPE A
<= Recv header, 9 bytes (0x9)
0000: 200 OK.
== Info: Connection #0 to host 192.168.2.104 left intact
=> Send header, 6 bytes (0x6)
0000: QUIT
<= Recv header, 14 bytes (0xe)
0000: 221 Goodbye.
== Info: Closing connection #0
~ #

 and idea why quote will not send the argument for CWD when using bash?

Thanks

-------------------------------------------------------------------
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