Subject: Re: fmt utility from NetBSD
To: None <>
From: John Darrow <>
List: tech-userlevel
Date: 04/28/2006 22:39:00
On 24 Apr 2006 13:27:13 -0500, Aleksey Cheusov <> wrote:
> >> I personally think that GNU fmt -s option is useful.
> >> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
> >>        -s, --split-only
> >>               split long lines, but do not refill
> >> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
>> FOLD(1)          NetBSD General Commands Manual             FOLD(1) 
>Unfortunately, 'fold -s' != 'GNU fmt -s'
>0 ~>printf '   q w e r t y u i o p\n' | fold -s -w 10
>   q w e 
>r t y u i 
>o p
>0 0 ~>printf '   q w e r t y u i o p\n' | gfmt -s -w 10
>   q w
>   e r t
>   y u i
>   o p
>0 0 ~>

NetBSD's default fmt (using goal of 9, max of 10, as goal and max
can't be equal):

>0 0 ~>printf '   q w e r t y u i o p\n' | fmt 9 10
   q w e
   r t y
   u i o

Personally, I don't like gfmt's shorting the first line to make the
last line longer.  That's the sort of "I know better than you what
you're trying to do" program behavior I expect to see out of Redmond.

While we're here, though, I think that fmt(1) should have an Xr to
fold(1), as I often think of the former command first when I really
want the latter's behavior (e.g. _not_ copying the first line indent
to the later lines).  An Xr from fold to fmt wouldn't hurt either.