bug-wget
[Top][All Lists]
Advanced

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

Re: [Bug-wget] wcat?


From: Pär Karlsson
Subject: Re: [Bug-wget] wcat?
Date: Thu, 20 Nov 2014 08:38:38 +0100

That does seem like an crazy amount of extra work (and code) for just a
simple wrapper. :-) And really, curl would be the way to do this on most
platforms/systems.

I'd be happy to do it, though, if there is enough interest from the people
on the list?

/Pär

2014-11-20 7:34 GMT+01:00 Darshit Shah <address@hidden>:

> On 11/19, Pär Karlsson wrote:
>
>> Or, realizing that even the simplest of shell scripts contain bugs, this
>> one is slightly better... and conforms better to GNU coding standards. :-)
>>
>> /Pär
>>
>>  Or realizing that Free Software means legal stuff, we need to modify
> this and add a legal notice about the GPL, a copyright years notice, and
> options to handle --help and --version. Because Wget's standard help cannot
> be used here.
> The script needs to eliminate any -O options passed to zcat.
>
> Also, if such a script is to go into productions systems, it needs more
> sanity checks for, as previously mentioned, other -O options among a couple
> of other things.
>
> I was just looking at the source for zcat. It's technically a one line
> shell script:
> exec gzip -cd "$@"
>
> However, the rest of cruft adds another 55 lines.
>
> And talking about legalities, I'm hoping you already have signed the
> assignment papers because otherwise that's even more work, before we can
> add this to the source. :-)
>
>
>  2014-11-19 22:50 GMT+01:00 Pär Karlsson <address@hidden>:
>>
>>  Or, if there's any real need, may I suggest this simple patch for making
>>> a
>>> wrapper in contrib/wcat? :-9
>>>
>>> Best regards,
>>>
>>> /Pär
>>>
>>> 2014-11-19 22:34 GMT+01:00 William Tracy <address@hidden>:
>>>
>>>  I meant to send this to the whole list, sorry.
>>>> ---------- Forwarded message ----------
>>>> From: "William Tracy" <address@hidden>
>>>> Date: Nov 19, 2014 1:32 PM
>>>> Subject: Re: [Bug-wget] wcat?
>>>> To: "Dagobert Michelsen" <address@hidden>
>>>> Cc:
>>>>
>>>> Two thoughts:
>>>>
>>>> 1. Curl already behaves this way out of the box, so the path of least
>>>> resistance here would be to just use curl. Curl lacks wget's crawling
>>>> features, but I don't see how you could use those features in this
>>>> context,
>>>> anyway.
>>>>
>>>> 2. If you are dead set on having a wcat command, you might have more
>>>> luck
>>>> getting this implemented by the package maintainer for your distribution
>>>> than by the core wget team.
>>>>
>>>> William
>>>> On Nov 19, 2014 12:41 PM, "Dagobert Michelsen" <address@hidden> wrote:
>>>>
>>>> > Hi Tim,
>>>> >
>>>> > > Am 17.11.2014 um 20:49 schrieb Tim Rühsen <address@hidden>:
>>>> > >
>>>> > > Am Montag, 17. November 2014, 09:05:52 schrieb Alfred M. Szmidt:
>>>> > >> It would be nice if wget also installed a wcat command which would
>>>> > >> default to something like,
>>>> > >>
>>>> > >>  wget -o /dev/null -O - "$@"
>>>> > >>
>>>> > >> Would it be possible to add something like that?
>>>> > >
>>>> > > Something like
>>>> > >
>>>> > > $ alias wcat='wget -o /dev/null -O -'
>>>> > > $ wcat www.example.com
>>>> > >
>>>> > > ?
>>>> > >
>>>> > > Put the alias into your ~/.bash_aliases or ~/.bashrc and that's it.
>>>> > >
>>>> > > What have I missed ;-) ?
>>>> >
>>>> > I think Alfred wants to have a behaviour similar to to gzip/gzcat
>>>> where
>>>> > you could also have similar structure but nonetheless gzip ships
>>>> gzcat,
>>>> > gzgrep etc.
>>>> >
>>>> >
>>>> > Best regards
>>>> >
>>>> >   — Dago
>>>> >
>>>> > --
>>>> > "You don't become great by trying to be great, you become great by
>>>> wanting
>>>> > to do something,
>>>> > and then doing it so hard that you become great in the process." -
>>>> xkcd
>>>> > #896
>>>> >
>>>> >
>>>>
>>>>
>>>
>>>
>  From 43cb7d02d3f6f4880fc92ee2f2982e21e5e58440 Mon Sep 17 00:00:00 2001
>> From: =?UTF-8?q?P=C3=A4r=20Karlsson?= <address@hidden>
>> Date: Wed, 19 Nov 2014 23:10:22 +0100
>> Subject: [PATCH] Added wcat convenience wrapper
>>
>> ---
>> contrib/wcat | 10 ++++++++++
>> 1 file changed, 10 insertions(+)
>> create mode 100755 contrib/wcat
>>
>> diff --git a/contrib/wcat b/contrib/wcat
>> new file mode 100755
>> index 0000000..3477d88
>> --- /dev/null
>> +++ b/contrib/wcat
>> @@ -0,0 +1,10 @@
>> +#!/bin/sh
>> +WGET=`which wget 2>/dev/null`
>> +if [ ! -x "${WGET}" ]; then
>> +  echo "No wget executable found in PATH"
>> +  exit 127
>> +fi
>> +
>> +"${WGET}" -q -O - "$@"
>> +
>> +# vim: tabstop=2 shiftwidth=2
>> --
>> 2.0.4
>>
>>
> --- end quoted text ---
>
> --
> Thanking You,
> Darshit Shah
>


reply via email to

[Prev in Thread] Current Thread [Next in Thread]