[Bug 210607] patch to bin/cat/cat.c to align output between when invoked with -be & -ne flags

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Fri Aug 5 16:22:54 UTC 2016


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=210607

--- Comment #4 from Sevan Janiyan <venture37 at geeklan.co.uk> ---
(In reply to John Baldwin from comment #3)

> 1) The 'BSD' output from CSRG is the current one, not NetBSD's recent change.  The other output has been in place for 35 years.

That made me smile, <3
ok, the NetBSD change is nearly 10 years old. :)

> 2) The language is not clear (and I'd be fine with clarifying it), but what you are changing is to have 'cat -be' insert extra leading blankspace for blank lines, but 'cat -b' does not.

>From the source code
/* -b implies -n */
/* -e implies -v */

Ignoring the -e flag & comparing the difference between -b & -n with the
following in a text file called a.txt
a b c

1 2 3

x y z

cat -b a.txt produces
     1  a b c

     2  1 2 3

     3  x y z

cat -n a.txt produces
     1  a b c
     2  
     3  1 2 3
     4  
     5  x y z

so if -b implies -n, when invoked with -e, would you build on that or give
another variant of output?

cat -be a.txt
     1  a b c$
        $
     2  1 2 3$
        $
     3  x y z$

or

cat -be f.txt
     1  a b c$
$
     2  1 2 3$
$
     3  x y z$

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-bugs mailing list