Plan 9 from Bell Labs’s /usr/web/sources/patch/applied/commfix/readme

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


test script:
cat >/tmp/f1 <<'!'
a
c
!
cat >/tmp/f2 <<'!'
b
c
!
fn r {
	echo $*
	$*
}
r comm /tmp/f1 /tmp/f2
r comm -1 /tmp/f1 /tmp/f2
r comm -2 /tmp/f1 /tmp/f2
r comm -3 /tmp/f1 /tmp/f2
r comm -23 /tmp/f1 /tmp/f2
r comm -12 /tmp/f1 /tmp/f2

before:
term% r comm /tmp/f1 /tmp/f2
comm /tmp/f1 /tmp/f2
a
	b
		c
term% r comm -1 /tmp/f1 /tmp/f2
comm -1 /tmp/f1 /tmp/f2
b
		c
term% r comm -2 /tmp/f1 /tmp/f2
comm -2 /tmp/f1 /tmp/f2
a
		c
term% r comm -3 /tmp/f1 /tmp/f2
comm -3 /tmp/f1 /tmp/f2
a
	b
term% r comm -23 /tmp/f1 /tmp/f2
comm -23 /tmp/f1 /tmp/f2
a
term% r comm -12 /tmp/f1 /tmp/f2
comm -12 /tmp/f1 /tmp/f2
	c

note the empty columns in comm -1, comm -2, and comm -12:
there is one tab too many.  it's an easy fix.  i noticed
only later that the plan 9 command was essentially the ancient
unix one, and a diff against that shows that indeed the l = 1 -> l = 2
was a change in going to plan 9, which dented it.

after:

doppio% r comm /tmp/f1 /tmp/f2
comm /tmp/f1 /tmp/f2
a
	b
		c
doppio% r comm -1 /tmp/f1 /tmp/f2
comm -1 /tmp/f1 /tmp/f2
b
	c
doppio% r comm -2 /tmp/f1 /tmp/f2
comm -2 /tmp/f1 /tmp/f2
a
	c
doppio% r comm -3 /tmp/f1 /tmp/f2
comm -3 /tmp/f1 /tmp/f2
a
	b
doppio% r comm -23 /tmp/f1 /tmp/f2
comm -23 /tmp/f1 /tmp/f2
a
doppio% r comm -12 /tmp/f1 /tmp/f2
comm -12 /tmp/f1 /tmp/f2
c

it now correctly suppresses columns.

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to webmaster@9p.io.