NetBSD-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: bin/56134: patch: add feedback to tee(1)
The following reply was made to PR bin/56134; it has been noted by GNATS.
From: "James K. Lowden" <jklowden%schemamania.org@localhost>
To: gnats-bugs%netbsd.org@localhost
Cc:
Subject: Re: bin/56134: patch: add feedback to tee(1)
Date: Mon, 3 May 2021 17:35:05 -0400
On Thu, 29 Apr 2021 22:15:02 +0000 (UTC)
"Jeremy C. Reed" <reed%reedmedia.net@localhost> wrote:
> From: "Jeremy C. Reed" <reed%reedmedia.net@localhost>
> To: gnats-bugs%netbsd.org@localhost
> Cc:
> Subject: Re: bin/56134: patch: add feedback to tee(1)
> Date: Thu, 29 Apr 2021 17:12:38 -0500 (CDT)
>
> > >How-To-Repeat:
> > $ find /usr/bin | ./tee -v | wc
> > 682617.19 KB/s (7,689 bytes in 0.000011 seconds)
> > 486 486 7689
>
> Not a perfect alternative, but also see
>
> t1:reed$ find /usr/bin | progress -e cat | wc
> 7887 4.81 MiB/s
> 498 498 7887
Not an exact replacement, but your suggestion is probably better.
I implemented your idea as /usr/local/bin/meter:
#! /bin/sh
exec /usr/bin/progress -e cat
How-To-Repeat:
$ find /usr/bin | meter | wc
7689 4.98 MiB/s
486 486 7689
That's pretty hard to beat, actually.
> (Or have you seen a "tee" like this?)
I have not.
Modifying progress(1) looks to be almost as much work as starting from
scratch, unless cat(1) were made the default argument. That would be
only imperceptibly more efficient than the 2-liner above.
If there's interest in wrapping progress around cat -- one way or the
other -- I could do that. Otherwise, thanks for suggesting a solution
I didn't think of.
BTW, the above script would be much nicer if this worked:
#! /usr/bin/progress -e cat
Is there interest in modifying the kernel to reliably pass, say, 9
arguments, instead of just 1 on the interpreter line? Or are we dead
set against? Asking for a friend.
--jkl
Home |
Main Index |
Thread Index |
Old Index