Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Does anyone know why

wget -O- http://www.google.com

and

wget -k http://www.google.com

work just fine, but

    wget -k -O- http://www.google.com

... never returns?

Using wget 1.12 under MacOS X and Debian

share|improve this question

1 Answer 1

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

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.