News for hackers. Stuff that matters.
Re:Why curl defaults to stdout by Touche on Monday November 17, 2014 @07:31AM (#8617857)
I find that weird. Why are you wanting to copy stuff from http all of the time? I only ever rarely do that because I want to examine something like an API response further for an extended period of time. Usually I just want to see the response once, or view the headers.
Re:Why curl defaults to stdout by coldtea on Monday November 17, 2014 @09:11AM (#8618231)
>I find that weird. Why are you wanting to copy stuff from http all of the time?

This kind of question (and the other question you make above) remind me of the people that answer Stack Overflow questions with their opinions of "best practices" and "what you should be doing instead" instead of answering what the poster asks. E.g:

Q. "How do I store JSON in mysql?"

A. "Why do you ask? What do you want to achieve with this? You'll be better served with a NoSQL database".

etc, etc.

Re:Why curl defaults to stdout by Morgawr on Monday November 17, 2014 @10:09AM (#8618472)
That is called the XY problem[0]. It is a fairly common practice especially in technical IRC channels. Honestly, it can be very frustrating but a lot of times it is useful and actually helps both the person asking the (wrong) question and the group of people trying to provide a proper answer. Some (maybe most?) people do take it too far and even refuse giving you a straightforward answer just to be pedantic and annoying. Those types of people have made this much of a bigger problem than it actually is, however thinking about the XY problem before you ask a question is always a good idea, regardless.

[0] - http://mywiki.wooledge.org/XyProblem

Re:Why curl defaults to stdout by LeonidasXIV on Monday November 17, 2014 @10:06AM (#8618460)
I actually like this, because posters often have XY-problems. Especially if the solution the poster wants seems strange if often makes sense to question and propose a more sane solution to the whole problem he is actually having.
Re:Why curl defaults to stdout by Touche on Monday November 17, 2014 @10:39AM (#8618635)
That's not what I was doing at all. My use of curl/wget is much different so I was curious of what they use cases are.
Re:Why curl defaults to stdout by scintill76 on Monday November 17, 2014 @07:42AM (#8617888)
A common use for wget for me is downloading a tarball or something to a remote server. Browse for it on local browser, then type wget and paste the download URL into an ssh connection. It is a bit biased toward wget just because I happened to learn it first, but I could use curl -O the same way.
Re:Why curl defaults to stdout by Tyr42 on Monday November 17, 2014 @10:32AM (#8618596)
Could also do `curl ${url}.tgz | tar xz`.
Re:Why curl defaults to stdout by coryrc on Monday November 17, 2014 @02:28PM (#8619943)
Which fails badly if the download gets interrupted.
Re:Why curl defaults to stdout by scintill76 on Monday November 17, 2014 @04:50PM (#8620875)
Yeah, and you can't check file integrity (hash or crypto signature) first, or list the contents of the file before extracting.
Re:Why curl defaults to stdout by viraptor on Monday November 17, 2014 @07:45AM (#8617897)
Not the parent, but as another data point for you: my history | grep wget contains: a movie, certificates bundle, zipball from github, DTD document from ncbi, GeoIP country list, some script from github, composer.phar, qemu source, some gist, steam deb, ... So basically "stuff". I download "stuff" when needed ;)
Re:Why curl defaults to stdout by barrkel on Monday November 17, 2014 @08:36AM (#8618115)
I don't use wget for testing APIs.

I use wget for long-running downloads when I need to be able to continue later, for simple mirroring, and for bootstrapping web scraping scripts. In fact, the combination of wget -i (url-file) -k and egrep can be enough for many simple web scraping needs. The -k is really handy - converting relative links to absolute links.

If I must use curl, I generally bootstrap it with "Copy as cURL" in the network tab of a browser's developer tools. But it's just not needed very often.

Re:Why curl defaults to stdout by pessimizer on Monday November 17, 2014 @08:24AM (#8618057)
People aren't lying to you when they say that they spend a lot of time on the command line:) Also - how else (other than wget) do you download something to some remote server somewhere?
Re:Why curl defaults to stdout by Tiksi on Tuesday November 18, 2014 @06:01AM (#8623376)
You could always use netcat:

    echo "GET / HTTP/1.1
    Host: news.ycombinator.com
    
    "|nc news.ycombinator.com 80 >yc
Re:Why curl defaults to stdout by willvarfar on Monday November 17, 2014 @08:44AM (#8618148)
> (other than wget)

Curl? :p

Re:Why curl defaults to stdout by pessimizer on Monday November 17, 2014 @08:47AM (#8618154)
Aren't we talking about curl?
Re:Why curl defaults to stdout by pessimizer on Monday November 17, 2014 @12:05PM (#8619091)
For people who have difficulty with reading: If you aren't downloading things with curl (which is the entire subject of the thread), how else (other than wget) would you download things to a remote server?

No need to answer, just helping out the non-native speakers in the thread.