cURL / Mailing Lists / curl-users / Single Mail

curl-users

curl https file upload output

From: Richard Vasquez <rickv_at_gmx.de>
Date: Thu, 15 Nov 2007 15:39:20 +0100

Hi,
When I run the following from the command line...

  % curl -F upload=@file -u test_usr:test_pwd -F press=Upload https://some.server.org/ >/dev/null
  % echo $?
  0

...everything looks fine and the file uploads as I wish.

but when I submit what I thought was the same command via a script like this...

  ### begin UNIX script
  #!/bin/ksh

  file=$1

  CURL_CMD="curl -F upload=@$file -u test_usr:test_pwd -F press=Upload https://some.server.org/ >/dev/null"

  `$CURL_CMD`
  RET=$?
  echo $RET
  ### end UNIX script

...the following is returned

<html>^M: not found
127

I'm using

curl 7.16.3 (sparc-sun-solaris2.8) libcurl/7.16.3 OpenSSL/0.9.8e zlib/1.2.3 libidn/0.5.19
Protocols: tftp ftp telnet dict ldap http file https ftps
Features: IDN IPv6 Largefile NTLM SSL libz

I'm a curl newbie and I expected the script to return 0 too!
I checked the curl docs and websites but couldn't find anything relating to this.
Thanks
Richard

-- 
Ist Ihr Browser Vista-kompatibel? Jetzt die neuesten 
Browser-Versionen downloaden: http://www.gmx.net/de/go/browser
Received on 2007-11-15