Plan 9 from Bell Labs’s /usr/web/sources/contrib/anothy/src/cmd/notify/readfile

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


#!/bin/rc

rfork e
tag=''
if(! test -w /srv/notify.$user) {
	echo 'No writable /srv/notify.'$user'. Run notify/acme or notify/rio.' >[1=2]
	exit 'notify'
}

if (~ $1 '-p') {
	shift
	tag=$1
}
if not
	tag=`{basename $1 >[2] /dev/null}

if(~ $tag '') {
	echo 'usage: ticker/readfile [-p] <file>'>[1=2]
	exit 'usage'
}
if not
	tag=$tag': '

while () {
	line=`{read $1}
	@{echo $tag $line >> /srv/notify.$user}
#	@{echo $tag $line}
}

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.