O que é o wget idiom para curl -o?

1

Então eu uso código em alguma função como

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

Eu me pergunto como conseguir a mesma coisa sem enrolar?

    
por myWallJSON 12.02.2012 / 19:40

1 resposta

6

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.
    
por 12.02.2012 / 20:00