plan9port/bin/B
rsc e89321a56e B that knows about address syntax,
change plumber to use it.
2003-12-02 21:57:32 +00:00

33 lines
475 B
Bash
Executable file

#!/bin/sh
if [ $# -eq 0 ]
then
echo 'usage: B cmd...' 2>&1
exit 1
fi
if [ "x$DISPLAY" = "x" ]
then
sam="/tmp/.sam.$USER"
else
sam="/tmp/.sam.$USER.$DISPLAY"
fi
if [ ! -p $sam ]
then
echo could not find sam 2>&1
exit 2
else
for i
do
pwd=`pwd`
file=`cleanname -d $pwd $i`
line=`echo $file | sed 's/.*://'`
file=`echo $file | sed 's/:.*//'`
echo "B $file" >>$sam
if [ "x$line" != "x" -a "x$line" != "x$file" ]
then
echo "$line" >> $sam
fi
done
fi