Plan 9 from Bell Labs’s /usr/web/sources/contrib/rsc/talk/striptease.awk

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


BEGIN {hdr=1; pn=0; pg=""}

/^p[0-9]+$/ {
	if(!hdr){
		pn++
		print "p" pn
		printf("%s", pg)
		pg = ""
	}
	hdr = 0
	next
}

hdr {
	print
	next
}

$0 == "x X copypage" {
	pn++
	print "p" pn
	printf("%s", pg)
}

!hdr {
	pg = pg $0 "\n"
}

END{
	if(!hdr){
		pn++
		print "p" pn
		printf("%s", pg)
		pg = ""
	}
}

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.