Plan 9 from Bell Labs’s /usr/web/sources/contrib/nemo/rc/bin/Arch

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


#!/bin/rc
# Do not edit this file. Edit /sys/src/cmd/mail2fs/... instead

# Be sure we remove only files under omero.
fn saferm {
	if (! ~ `{echo $1 | wc -l} 1 || 
	echo $1 | grep '([^a-zA-Z0-9_./:])|(\.\.)' >/dev/null ||
	! echo $1 | grep '^/devs/[a-z]*ui/' >/dev/null)
		echo no rm for $1 >/dev/null
	if not {
		rm -rf $1/*
		rm -f $1
	}
}

if ( ~ $#* 0) { 
	dir=`{basename -d $file}
	cd /
	test -d $dir || exit ''
	mv $dir `{echo $dir | sed 's|(.*/)([0-9]+)$|\1a.\2|'}
	if (! ~ $#panel 0 && ~ $panel /devs/*)
		rm -rf $panel
	if not
		saferm `{ofiles | grep $file'$' | sed 's|/tag:tag.*||'}
}
if not {
	if (~ $1 -f){
		shift
		for (m in $*) {
			mv $m `{echo $m | sed 's|(.*/)([0-9]+)$|\1a.\2|'}
		}
	}
	if not
		echo Arch -f $*
}
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 webmaster@9p.io.