Sun 01 Jan 2017 10:11:27 PM UTC, comment #3:
In regard to tilde, you can use some tricky constructions to exploit the fact that you don't have to quote all of the characters in an argument of a command line. (In fact, the shell records whether each character was quoted, and the special treatment of tildes in Bash is triggered when "a word begins with an unquoted tilde character".)
Thus,
wget -O ~/"image 17.jpg"
writes output into a file in your home directory whose name contains a space.
In regard to combining -O and -P, the manual page says:
-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.
Since -P sets the root of the retrieval tree, and -O dispenses with a "retrieval tree" entirely, you would expect -O to override -P. However, this should probably be documented more clearly.
|