#!/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}
}
|