cURL / Mailing Lists / curl-users / Single Mail

curl-users

Linux: curl command doesnt like the use of ${} in bash.

From: Brian Hare <paroxsitic_at_gmail.com>
Date: Fri, 21 Sep 2007 09:31:21 -0400

This is the code:

        ID=${textArray[$i]}
        curl -v -L -b cookies.txt
"http://www.duels.com/challenges/skirmish/$ID" > scrim.html

This is the verbose output:

 HTTP/1.1allenges/skirmish/594
> User-Agent: curl/7.15.5 (i486-pc-linux-gnu) libcurl/7.15.5 OpenSSL/0.9.8c zlib/1.2.3 libidn/0.6.5
> Host: www.duels.com
> Accept: */*
> Cookie: phpbb2mysql_sid=fffcbc5cf2d66a87eb166f744ddf019d; phpbb2mysql_data=a%3A2%3A%7Bs%3A11%3A%22autologinid%22%3Bs%3A32%3A%223e76a55dc717101124a0a1cac78d80a4%22%3Bs%3A6%3A%22userid%22%3Bs%3A5%3A%2232214%22%3B%7D; Duels[UserId]=Q2FrZQ%3D%3D.qnXn5Gc%3D; CAKEPHP=7fjnvp2gaij0jqibcu6vkt4eu6
>
< HTTP/1.1 200 OK
< Date: Fri, 21 Sep 2007 13:21:32 GMT
< Server: Apache/2.0.59 (CentOS)
< X-Powered-By: PHP/5.1.6
< P3P: CP="NOI ADM DEV PSAi COM NAV OUR OTRo STP IND DEM"
< Content-Length: 0
< Content-Type: text/html; charset=UTF-8
* Replaced cookie CAKEPHP="7fjnvp2gaij0jqibcu6vkt4eu6" for domain
www.duels.com, path /, expire 0
< Set-Cookie: CAKEPHP=7fjnvp2gaij0jqibcu6vkt4eu6; path=/
< Vary: Accept-Encoding
  % Total % Received % Xferd Average Speed Time Time Time Current
                                 Dload Upload Total Spent Left Speed
  0 0 0 0 0 0 0 0 --:--:-- --:--:--
--:--:-- 0* Connection #0 to host www.duels.com left intact

* Closing connection #0

Notice the HTTP/1.1allenges/skirmish/594. 594 is $ID but the
allenges is where the error occurs. If I manually change the code to:

curl -v -L -b cookies.txt
"http://www.duels.com/challenges/skirmish/594" > scrim.html

Then it works perfectly and it displays HTTP/1.1 /challenges/skirmish/594.

Does anyone know what my problem is, and if there is a workaround to this?
Received on 2007-09-21