Re: [PATCH v2 09/22] t/t4*: avoid redundant uses of cat

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

 



Taylor Blau <me@xxxxxxxxxxxx> writes:

> This and the two similar transformations below it look good to me. This
> obviously isn't the fault of your patch (nor should it necessarily be
> its aim to fix), but I wonder if it would be worthwhile to extract the
>
>     tr "\0" "\n" <out | head -n 3 | grep 3.bar | cut -f 2 -d " "
>
> pattern into a helper function, since it's used in a few places in this
> test script.

I somehow thought that the theme of the topic is to reduce the depth
of the pipeline.  "head -n 3" piped into "grep" sounds something a
single sed script can do, e.g.

	tr '\000' '\012' <out |	sed -n -e '1,3s/3.bar/&/p'

> That's just a suggestion, and shouldn't hold up this patch/series. Maybe
> just some #leftoverbits :-).

Ditto.  The whole thing can be turned into a Perl scriptlet, which
may be even easier to read (the cost to spin up one Perl interpreter
might be greater than constructing 4 process pipeline on certain
systems, though).

Thanks.

P.S. It is nice to hear from you Taylor.  It's been a while.





[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux