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

Copyright © 2009 Alcatel-Lucent.
Distributed under the Lucent Public License version 1.02.
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 ''


(This is a user-contributed directory and
should not be interpreted as statement by Alcatel-Lucent.)

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2009 Alcatel-Lucent. All Rights Reserved.
Comments to webmaster@plan9.bell-labs.com.