Plan 9 from Bell Labs’s /usr/web/sources/contrib/nemo/root/sys/src/cmd/mail2fs/Msgs

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


#!/bin/rc
rfork e
if (~ $#file 0){
	echo must run under omero. Acme has its own reader. >[1=2]
	exit omero
}
if(~ $#* 0)
	mbox=/mail/box/$user/msgs
if not
	mbox=$1

fn isforeign {
	fk=`{file <{sed -n '/^$/,$p' $1/text}}
	if(~ $"fk *apanese* *yrillic* *rabic* *hinese* *ussian*)
		status=''
	if not
		status='not foreign'
}

fn spam {
	aname=`{echo $1 | sed 's,/(.\.)?([0-9]*)$,/s.\2,'}
	~ $1 $aname || mv $1 $aname
}

if(test -e $mbox/*/[0-9]*)
for(m in $mbox/*/[0-9]*){
	if(isforeign $m)
		spam $m
}

msgs $* 

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.