Plan 9 from Bell Labs’s /usr/web/sources/contrib/nemo/root/acme/msgs/Mg

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


#!/bin/rc
rfork e
opth=n
if (! ~ $#1 0 && ~ $1 -h){
	opth=y
	shift
}
if (~ $#* 0){
	echo usage: Mg [-h] args >[1=2]
	exit usage
}

msgs=`{cat /tmp/msgs.$user | 
	grep '.*/[0-9]*/(.\.)?[0-9]*(/.*)?$' |
	sed -e 's|((.*/)?[0-9]*/(.\.)?[0-9]*)(/.*)?|\1/text|'}

for (m in $msgs){
	if (~ $opth y){
		if (sed '/^$/q' $m | grep -s $*)
			echo $m
	}
	if not {
		if (grep  -s $* $m /dev/null)
			echo $m
	}
}
exit ''


Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to [email protected].