tech-userlevel archive

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

Re: [patch] cat -n bug from 33 years ago



On Sat, Nov 18, 2023 at 05:59:15PM +0100, Rhialto wrote:
> On Wed 15 Nov 2023 at 08:04:42 -0300, Crystal Kolipe wrote:
> > The attached patch fixes a bug in /bin/cat when using -n with multiple input
> > files.  This bug seems to have been introduced in 4.3BSD-Reno.
> > 
> > Numbering currently starts over at 1 for each input file, here is a simple
> > reproducer:
> 
> If you want to have continuing (non-restarting) numbering for multiple
> input files, one could use "cat file1 file2 | cat -n".

True, that would be a workaround.

But shouldn't the current behaviour still be fixed?  The restarting for each
file has never been mentioned in the manual as a feature, and it isn't what
most people would expect.


Home | Main Index | Thread Index | Old Index