curl / Mailing Lists / curl-users / Single Mail
Buy commercial curl support from WolfSSL. We help you work out your issues, debug your libcurl applications, use the API, port to new platforms, add new features and more. With a team lead by the curl founder himself.

Re: uploading a file

From: Paul Gilmartin via curl-users <>
Date: Fri, 25 Sep 2020 10:32:29 -0600

On 2020-09-25, at 07:58:55, mehran j via curl-users <> wrote:
> In a shell scrip.
> date
> a=`date '+%y%m%d'`;export a
> 2. Then script that runs creates the new test.csv file
> 3. mv /directory/test.csv /directory/test_$a.csv
> 4. curl --user user:password -T '/user/directory1/test_$a.csv' 'https://webcloud/directory1/directory2/'
> 5. mv yesterday's test_date.csv file onto processed directory.
> The CURL bit is not working unless it like curl --user user:password -T '/user/directory1/test_20200925.csv' 'https://webcloud/directory1/directory2/'
> ie: exact name for the csv file like test_20200925.csv rather than test_$a.csv
I'll revise my suggestion:

set -x # Keep a log (but where does it go?)
a=`date '+%y%m%d'`;export a # looks good.

# Then use quotation marks instead of apostrophes:
    curl --user user:password -T "/user/directory1/test_$a.csv" 'https://webcloud/directory1/directory2/'

-- gil

Received on 2020-09-25