Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

So I use code in some function like

if [ ! -e $DOWNLOADS/$1 ]; then
    echo_run curl -L http://$4/$5/$1 -o $DOWNLOADS/$1
fi

I wonder how to achieve the same thing without curl?

share|improve this question

1 Answer 1

Dixit man wget:

   -O file
   --output-document=file
       The documents will not be written to the appropriate files, but all will be concatenated together
       and written to file.  If - is used as file, documents will be printed to standard output,
       disabling link conversion.  (Use ./- to print to a file literally named -.)

       Use of -O is not intended to mean simply "use the name file instead of the one in the URL;"
       rather, it is analogous to shell redirection: wget -O file http://foo is intended to work like
       wget -O - http://foo > file; file will be truncated immediately, and all downloaded content will
       be written there.
share|improve this answer
    
Just curious, what is the meaning of "dixit"? –  jw013 Feb 13 '12 at 6:21
2  
@jw013: in this context, it's roughly "thus says". It's an allusion to "Dixit Algorismi", an early manuscript on arithmetic; i.e. a quote from authorative work. –  Ulrich Schwarz Feb 13 '12 at 6:57

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.