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

Re: Another "useless us of cat" discussion



On Sat 31 Aug 2019 at 11:43:09 (-0400), The Wanderer wrote:
> On 2019-08-31 at 11:16, David Wright wrote:
> > On Sat 31 Aug 2019 at 10:40:52 (-0400), The Wanderer wrote:
> >> On 2019-08-31 at 10:32, Teemu Likonen wrote:
> 
> >>> Discussions about "useless use of cat" have wasted far more
> >>> resources than the actual use of cat command.
> >> 
> >> Agreed. I'm sorry for having started another one (and for
> >> continuing it, for that matter, although apparently not sorry
> >> enough to have not done so), out of trying to forestall exactly
> >> that.
> > 
> > I wouldn't worry about it. Hey, how about this for a cat function
> > that I've occasionally found use for:
> > 
> > function -cat {
> >     cat
> > }
> > 
> > I don't know whether it's obvious where one might use this.
> 
> It isn't to me, at least, although trying to figure it out is an
> interesting brainteaser.

I'd hate for you to waste too much time on it!

When you're prototyping some long pipeline like

some-producer | foo -some --complex -combo -of --switches | some-consumer

it makes it easy to nullify foo without disturbing anything else.

some-producer | -cat -some --complex -combo -of --switches | some-consumer

IOW it just bypasses foo without choking on the switches. Is that
enough of a "useless cat"?

Cheers,
David.


Reply to: