Plan 9 from Bell Labs’s /usr/web/sources/contrib/rsc/scripts/Clean

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


#!/bin/rc

rfork e

if(~ $#* 0)
	pattern=.
if not
	pattern=$1

cd /mnt/acme
for (i in [0-9]*){
	if(test -d $i){
		tag=`{cat $i/tag}
		tagline = $"tag
		file=$tag(1)

		# must match our pattern if given, must be a clean window,
		# and must not be an Errors window, mail, or win.

		if(! ~ $file */ *+Errors* */-* */mail/* && ! ~ $tagline *Put* 
		&& echo $file | grep $pattern >/dev/null >[2]/dev/null)
			echo del >$i/ctl
	}
}
status=''

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.