up vote 0 down vote favorite
share [g+] share [fb]

In a bash script, I am using curl command on linux to download files from a FTP server.

The command I am using is the following (the information about the FTP server connexion is stored in a .netrc file):

curl -v -netrc "ftp://my.ftp.server/foo/bar.txt" -o bar.txt

This is working pretty well, except that if the bar.txt is empty (size file = 0).

How do I force curl to download the file, i.e. getting a bar.txt which is empty?

link|improve this question
If you omit the '-o' option, does it display the file to stdout? Does the file on the FTP server actually contain anything? What troubleshooting have you done? – EmmEff Sep 18 '09 at 14:07
FWIW: If using netrc you need to use two dashes: --netrc. I would try to use curl --trace-ascii - --netrc "my.ftp.server/foo/bar.txt"; and check the output. – Wolf Jan 18 '10 at 16:04
feedback

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
or
required, but never shown

Browse other questions tagged or ask your own question.