Plan 9 from Bell Labs’s /usr/web/sources/contrib/btdn/src/issue/note

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


#!/bin/rc

rfork e
if(! ~ $#* 2){
	echo 'usage: issue/note 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
#	}
#}

if(! test -d $tracker/$2/$1){
	echo 'no such issue' $tracker/$2/$1 >[1=2]
	exit noissue
}

cd $tracker/$2/$1 || exit noissue

if(~ `{cat /proc/$pid/fd | awk 'NR==2{print $NF}'} */dev/cons && ~ `{ls -l /dev/consctl | awk '{print $1}'} *rw*){
	>/dev/consctl {
		echo holdon
		{echo `{date} `{cat /dev/user}
		cat |sed 's/^/    /'; echo } >>notes
	}
}
if not
	{echo `{date} `{cat /dev/user}
	cat |sed 's/^/    /'; echo } >>notes


Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to [email protected].