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 2014-11-19 22:50 GMT+01:00 Pär Karlsson <feino...@gmail.com>: > 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 <afishion...@gmail.com>: > >> I meant to send this to the whole list, sorry. >> ---------- Forwarded message ---------- >> From: "William Tracy" <afishion...@gmail.com> >> Date: Nov 19, 2014 1:32 PM >> Subject: Re: [Bug-wget] wcat? >> To: "Dagobert Michelsen" <d...@opencsw.org> >> 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" <d...@opencsw.org> wrote: >> >> > Hi Tim, >> > >> > > Am 17.11.2014 um 20:49 schrieb Tim Rühsen <tim.rueh...@gmx.de>: >> > > >> > > 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?= <feino...@gmail.com> 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