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.
 
> 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.

> Then you need -R to get the correct timestamp applied.

I don't care about the timestamp.  All I need to do is scrape the room 
temperatures (a total of 20 bytes) from the entire output of several KB.
 
> 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.  Indeed, it is preferred.  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.  One line with curl. It was over a dozen with wget.

> 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...".  'Not that I 
mind the extraneous information concerning the broader merits of wget vs curl, 
but I am trying to solve a specific problem here, after all.


--
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: 
https://lists.debian.org/ca4e92b6-7e4a-4aae-9d88-1be3e4994...@googlegroups.com

Reply via email to