[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: wget fails in Debian Jessie



Quoting Leslie Rhorer (lrhorer@mygrande.net):
> On Sunday, June 7, 2015 at 7:10:03 PM UTC-5, David Wright wrote:
> > Quoting Leslie Rhorer:
> > > On Sunday, June 7, 2015 at 4:00:04 AM UTC-5, Reco wrote:
> > > 
> > > > > Does anyone have any ideas how I could get curl to handle the task, since wget is failing?  Some other utility?
> > > > 
> > > > Don't depend on curl. Use good old socat combined with wget:
> > > 
> > > Why?  The -L option in curl did the trick.  Is there some over-riding reason why I should use wget instead of curl?  Curl windsup being simpler and faster in this case.
> > 
> > I'm not commenting on this particular case, but the default options in
> > curl are a pain in the proverbial.
> 
> I was asking about this case.

Of course you were. That's why you posted. And that's why I preceded
my post with "I'm not commenting on this particular case". Perhaps I
should have started with

\begin{Oblique opinions on the default options in curl compared with
the behaviour of wget}

> > As I mentioned 8 April, curl outputs to stdout so you've got to set
> > -O to get the "correct" filename.
> 
> Since it's easier in this case *NOT* to have the output sent to a file (or worse, a directory structure), curl is easier.

wget -O - if so required; therefore irrelevant in a script.

> > Then you need -R to get the correct timestamp applied.
> 
> I don't care about the timestamp.

Irrelevant for standard output.

> > You also need to check for the existence of a file of the same name
> > else curl will silently overwrite it. I haven't figured out an alias
> > to prevent this.
> 
> Since I *want* the file overwritten every time the script runs, this isn't a problem.

Irrelevant for standard output.

> Indeed, it is preferred.

Why, if it's irrelevant to you?

The default action of cp, for example, is overwriting. That's why I
and many others spell cp as cp -i. But curl appears to have no
equivalent of the -i switch, which I think is a great failing, not
something to be preferred! I say this hoping someone will contradict me.

> That, plus I don't have curl write to the file directly.  I pipe the result to grep and then sed, and then redirect that output to the file.

...which has more to do with bash's clobber than the behaviour of
either wget or curl, which is at the other end of the pipe and
therefore has no knowledge of any output file.

> One line with curl. It was over a dozen with wget.

So?

> > wget handles these cases correctly. curl might be fine for scripting
> > but I find wget far friendlier for interactive use.
> 
> The first four words in my original post were "I had a script...".

...and that line was ~680 characters long. Please wrap.

> 'Not that I mind the extraneous information concerning the broader merits of wget vs curl,

Phew.

> but I am trying to solve a specific problem here, after all.

...and I hope I haven't stood in the way of others helping you.

Cheers,
David.


Reply to: