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

Another "useless us of cat" discussion



The Wanderer [2019-08-31T08:39:56-04] wrote:

> (Yes, that's technically a "senseless use of cat". I do it anyway,
> because always using pipes at every stage makes it easy to add or
> remove filtering stages without having to adjust the syntax in another
> part of the pipeline, and because it's easier to stick with that
> habitual pattern than to change it up in the relatively few cases
> where I can be sure that multiple stages aren't and won't be needed.)
>
> (And may I say that it's annoying to need to explain this every time,
> in order to forestall being called out for "senseless use of cat"? Not
> that I get called out for that here very much, but it does seem to
> happen virtually every time I don't include an explanation...)

Discussions about "useless use of cat" have wasted far more resources
than the actual use of cat command.

For the command and information ordering discussion I'll remind that
shell redirections can be placed also before the command. Commands

    $ cat input | command

can be replaced with

    $ <input command

-- 
///  OpenPGP key: 4E1055DC84E9DFF613D78557719D69D324539450
//  https://keys.openpgp.org/search?q=tlikonen@iki.fi
/  https://keybase.io/tlikonen  https://github.com/tlikonen

Attachment: signature.asc
Description: PGP signature


Reply to: