Re: wc(1): add -L flag to write length of longest line

2022-10-01 Thread Sebastian Benoit
Theo de Raadt(dera...@openbsd.org) on 2022.09.30 11:11:42 -0600: > I'm sure there are other people have other desireable features which I > haven't listed. For instance, could wc.c be the scaffold to use for the > long-desired web browser to be included in OpenBSD? Oh, it's clearly incomplete

Re: wc(1): add -L flag to write length of longest line

2022-10-01 Thread Marc Espie
On Fri, Sep 30, 2022 at 02:22:34AM +0200, Joerg Sonnenberger wrote: > On Thu, Sep 29, 2022 at 08:39:16PM +1000, Jonathan Gray wrote: > > wc counts items in files. Finding the longest item indeed sounds > > like a task better suited to awk. > > Finding outliers, means and counting are all parts

Re: wc(1): add -L flag to write length of longest line

2022-09-30 Thread Theo de Raadt
Todd C. Miller wrote: > On Thu, 29 Sep 2022 23:30:54 -0400, Daniel Dickman wrote: > > > > On Sep 29, 2022, at 8:24 PM, Joerg Sonnenberger wrote: > > > > > > On Thu, Sep 29, 2022 at 08:39:16PM +1000, Jonathan Gray wrote: > > >> wc counts items in files. Finding the longest item indeed sounds

Re: wc(1): add -L flag to write length of longest line

2022-09-30 Thread Todd C . Miller
On Thu, 29 Sep 2022 23:30:54 -0400, Daniel Dickman wrote: > > On Sep 29, 2022, at 8:24 PM, Joerg Sonnenberger wrote: > > > > On Thu, Sep 29, 2022 at 08:39:16PM +1000, Jonathan Gray wrote: > >> wc counts items in files. Finding the longest item indeed sounds > >> like a task better suited to

Re: wc(1): add -L flag to write length of longest line

2022-09-29 Thread Daniel Dickman
> On Sep 29, 2022, at 8:24 PM, Joerg Sonnenberger wrote: > > On Thu, Sep 29, 2022 at 08:39:16PM +1000, Jonathan Gray wrote: >> wc counts items in files. Finding the longest item indeed sounds >> like a task better suited to awk. Doesn’t gnu wc show that tabs have length 8 rather than

Re: wc(1): add -L flag to write length of longest line

2022-09-29 Thread Joerg Sonnenberger
On Thu, Sep 29, 2022 at 08:39:16PM +1000, Jonathan Gray wrote: > wc counts items in files. Finding the longest item indeed sounds > like a task better suited to awk. Finding outliers, means and counting are all parts of the same basic class of operations. A good implementation of all of them

Re: wc(1): add -L flag to write length of longest line

2022-09-29 Thread Jonathan Gray
On Thu, Sep 29, 2022 at 08:57:04AM +, Job Snijders wrote: > Hi all, > > I often find myself piping data through ... | awk '{print length}' | ... > I figured there should be a more direct way that requires less typing. > Perhaps other developers have a similar itch? > > The FreeBSD, NetBSD,

wc(1): add -L flag to write length of longest line

2022-09-29 Thread Job Snijders
Hi all, I often find myself piping data through ... | awk '{print length}' | ... I figured there should be a more direct way that requires less typing. Perhaps other developers have a similar itch? The FreeBSD, NetBSD, Dragonfly, and GNU variants of the wc(1) utility have a similar -L feature.