Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Does anyone know why

wget -O-


wget -k

work just fine, but

    wget -k -O-

... never returns?

Using wget 1.12 under MacOS X and Debian

share|improve this question
up vote 5 down vote accepted

This call is somewhat nonsensical, because -k is for converting links relative to the local storage location, but with -O- you are not specifying a local storage location.

What actually appears to happen is that wget is attempting to look at the output file after having downloaded it, in order to apply the -k modifications, but the output is to the terminal, so it waits on the terminal. If you send an EOF on the terminal (press Ctrl+D), the call terminates. It obviously can't do anything with what you enter, because the output was already printed.

On might think that wget should detect this situation, but note that Unix utilities are generally device independent and quite happily wait on a terminal if you have somehow failed to supply input (compare grep).

share|improve this answer
Hi Peter, I see you do not have only a deep understanding of Postgreql, but also of Unix too. Thanks for your reply! – plang Jan 6 '11 at 10:01

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .