Re: Small change to wc

2008-12-16 Thread Václav Haisman
Sheldon Givens wrote, On 5.12.2008 23:14: > Hello everyone, > In the process of migrating the last of a few Linux servers to FreeBSD, we > ran in to a bit of a snag with one of our scripts when BSD wc didn't have an > equivalent to the Linux -L. This flag tells wc to keep track of the longest > lin

Re: Small change to wc

2008-12-16 Thread Giorgos Keramidas
On Tue, 16 Dec 2008 23:25:07 +0100, Lars Engels wrote: >On Sat, Dec 06, 2008 at 09:25:05PM +0200, Giorgos Keramidas wrote: >>On Sat, 06 Dec 2008 17:40:14 +0200, Giorgos Keramidas >> wrote: >>> The updated patch, and a manpage change to document the new option is >>> attached below. Konstantin, i

Re: Small change to wc

2008-12-16 Thread Lars Engels
On Sat, Dec 06, 2008 at 09:25:05PM +0200, Giorgos Keramidas wrote: > On Sat, 06 Dec 2008 17:40:14 +0200, Giorgos Keramidas > wrote: > > The updated patch, and a manpage change to document the new option is > > attached below. Konstantin, if you like this version of the patch, > > I'll commit it

Re: Small change to wc

2008-12-06 Thread Giorgos Keramidas
On Sat, 06 Dec 2008 17:40:14 +0200, Giorgos Keramidas <[EMAIL PROTECTED]> wrote: > The updated patch, and a manpage change to document the new option is > attached below. Konstantin, if you like this version of the patch, > I'll commit it to /head and schedule an MFC after a week or so. Committed

Re: Small change to wc

2008-12-06 Thread Giorgos Keramidas
On Sat, 06 Dec 2008 13:57:53 +0200, Giorgos Keramidas <[EMAIL PROTECTED]> wrote: >>> Can you post a `diff -u' or `diff -c' version of the patch? I like the >>> idea of the new option but it would be easier to read in -u/-c format. >> >> New diff -u: > > Excellent, thanks! Other than a few minor s

Re: Small change to wc

2008-12-06 Thread Giorgos Keramidas
On Fri, 5 Dec 2008 18:46:00 -0800, "Sheldon Givens" <[EMAIL PROTECTED]> wrote: > On Fri, Dec 5, 2008 at 4:17 PM, Giorgos Keramidas <[EMAIL PROTECTED]>wrote: >> Adding the option to increase finger-compatibility and make shell >> scripts a bit easier to port over sounds fine by me :) >> >> > My apol

Re: Small change to wc

2008-12-05 Thread Garrett Cooper
On Fri, Dec 5, 2008 at 3:28 PM, Sheldon Givens <[EMAIL PROTECTED]> wrote: > I've successfully built it in multiple circumstances. The only thing I'm > worried about (I'm on the road now and can't test) is what will occur if wc > is fed a zero-length input... ie, a "touched" file or a echo "" | wc -

Re: Small change to wc

2008-12-05 Thread Sheldon Givens
New diff -u: --- /usr/src/usr.bin/wc/wc.c2004-12-27 14:27:56.0 -0800 +++ wc/wc.c 2008-12-05 14:33:21.0 -0800 @@ -62,8 +62,8 @@ #include #include -uintmax_t tlinect, twordct, tcharct; -int doline, doword, dochar, domulti; +uintmax_t tlinect, twordct, tcharct, tlongline;

Re: Small change to wc

2008-12-05 Thread Giorgos Keramidas
On Fri, 5 Dec 2008 14:14:32 -0800, "Sheldon Givens" <[EMAIL PROTECTED]> wrote: > Hello everyone, > In the process of migrating the last of a few Linux servers to > FreeBSD, we ran in to a bit of a snag with one of our scripts when BSD > wc didn't have an equivalent to the Linux -L. This flag tells

Re: Small change to wc

2008-12-05 Thread Mike Meyer
On Sat, 6 Dec 2008 01:14:58 +0200 Kostik Belousov <[EMAIL PROTECTED]> wrote: > On Fri, Dec 05, 2008 at 03:10:56PM -0800, Sheldon Givens wrote: > > What's the problem having it? The total code is mere bytes and it eases the > > transition for others who are migrating from Linux. > > You're absolute

Re: Small change to wc

2008-12-05 Thread Sheldon Givens
I've successfully built it in multiple circumstances. The only thing I'm worried about (I'm on the road now and can't test) is what will occur if wc is fed a zero-length input... ie, a "touched" file or a echo "" | wc -L. On Fri, Dec 5, 2008 at 3:23 PM, Garrett Cooper <[EMAIL PROTECTED]> wrote: >

Re: Small change to wc

2008-12-05 Thread Garrett Cooper
On Fri, Dec 5, 2008 at 3:14 PM, Kostik Belousov <[EMAIL PROTECTED]> wrote: > On Fri, Dec 05, 2008 at 03:10:56PM -0800, Sheldon Givens wrote: >> What's the problem having it? The total code is mere bytes and it eases the >> transition for others who are migrating from Linux. >> You're absolutely rig

Re: Small change to wc

2008-12-05 Thread Julian Elischer
Garrett Cooper wrote: On Fri, Dec 5, 2008 at 2:14 PM, Sheldon Givens <[EMAIL PROTECTED]> wrote: Hello everyone, In the process of migrating the last of a few Linux servers to FreeBSD, we ran in to a bit of a snag with one of our scripts when BSD wc didn't have an equivalent to the Linux -L. This

Re: Small change to wc

2008-12-05 Thread Kostik Belousov
On Fri, Dec 05, 2008 at 03:10:56PM -0800, Sheldon Givens wrote: > What's the problem having it? The total code is mere bytes and it eases the > transition for others who are migrating from Linux. > You're absolutely right in that it can be done with awk (fairly simply, too) > but it doesn't hurt to

Re: Small change to wc

2008-12-05 Thread Sheldon Givens
What's the problem having it? The total code is mere bytes and it eases the transition for others who are migrating from Linux. You're absolutely right in that it can be done with awk (fairly simply, too) but it doesn't hurt to explore options. Additionally, with awk, you can't get other figures wi

Re: Small change to wc

2008-12-05 Thread Garrett Cooper
On Fri, Dec 5, 2008 at 2:48 PM, Garrett Cooper <[EMAIL PROTECTED]> wrote: > On Fri, Dec 5, 2008 at 2:14 PM, Sheldon Givens <[EMAIL PROTECTED]> wrote: >> Hello everyone, >> In the process of migrating the last of a few Linux servers to FreeBSD, we >> ran in to a bit of a snag with one of our scripts

Re: Small change to wc

2008-12-05 Thread Garrett Cooper
On Fri, Dec 5, 2008 at 2:14 PM, Sheldon Givens <[EMAIL PROTECTED]> wrote: > Hello everyone, > In the process of migrating the last of a few Linux servers to FreeBSD, we > ran in to a bit of a snag with one of our scripts when BSD wc didn't have an > equivalent to the Linux -L. This flag tells wc to

Small change to wc

2008-12-05 Thread Sheldon Givens
Hello everyone, In the process of migrating the last of a few Linux servers to FreeBSD, we ran in to a bit of a snag with one of our scripts when BSD wc didn't have an equivalent to the Linux -L. This flag tells wc to keep track of the longest line in the input. Here's a little diff to add this fu