Plan 9 from Bell Labs’s /usr/web/sources/contrib/boyd/sys/src/cmd/822flatten.html

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


<html>
<body>
<pre>
<tt>
#!/bin/sh

# 822flatten
#
# Flatten RFC 822 headers that span multiple lines

awk '
$0 ~ /^$/ { exit }

$0 !~ /^[ 	]/ {
	if (h != "")
	{
		print h
		h = ""
	}
}

{
	h = h $0
}

END {
	if (h != "")
	{
		print h
		h = ""
	}
}
' | sed 's/,  */, /g'
</tt>
</pre>
<HR>
&copy 1998,
Boyd Roberts:
<A HREF="mailto:boyd@fr.inter.net">boyd@fr.inter.net</A>
</body>
</html>

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.