Plan 9 from Bell Labs’s /usr/web/sources/contrib/btdn/src/issue/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: issue/move dst issue-name state' >[1=2]
	exit usage
}

# Doesn't (yet?) exist
#tracker=/n/sources/issue
tracker=./test

#if(~ $tracker /n/sources/issue){
#	if(! test -d /n/sources/issue){
#		rfork n
#		9fs sources
#	}
#}

dst=$1
issue=$2
state=$3

i=$state/$issue
j=$issue

echo $i

if(! test -d $tracker/$i)
	echo 'no such issue' $tracker/$i >[1=2]
if not if(test -d $tracker/$dst/$j)
	echo 'already have' $tracker/$dst/$j >[1=2]
if not
	ls -ldp $tracker/$i >$tracker/$i/origls &&
	mkdir $tracker/$dst/$j && 
	dircp $tracker/$i $tracker/$dst/$j &&
	rm -rf $tracker/$i &&
	test -s $tracker/$dst/$j/email &&
#	Only the lab has this
#	issue/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.