Plan 9 from Bell Labs’s /usr/web/sources/contrib/someone/root/rc/bin/patch/move

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


#!/bin/rc

rfork e
if(~ $#* 0 1){
	echo 'usage: patch/move dst patch-name...' >[1=2]
	exit usage
}

if(! test -d /n/sources/patch){
	rfork n
	9fs sources
}

dst=$1
shift
for(i){
	j=`{basename $i}
	if(! test -d /n/sources/patch/$i)
		echo 'no such patch' /n/sources/patch/$i >[1=2]
	if not if(test -d /n/sources/patch/$dst/$j)
		echo 'already have' /n/sources/patch/$dst/$j >[1=2]
	if not
		ls -ldp /n/sources/patch/$i >/n/sources/patch/$i/origls &&
		mkdir /n/sources/patch/$dst/$j && 
		dircp /n/sources/patch/$i /n/sources/patch/$dst/$j &&
		rm -rf /n/sources/patch/$i &&
		test -s /n/sources/patch/$dst/$j/email &&
		patch/notify $dst/$j
}

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.