plan9port/bin/B
2004-04-19 05:51:41 +00:00

43 lines
561 B
Bash
Executable file

#!/bin/sh
files=""
dest=""
if [ $# -eq 0 ]
then
echo 'usage: B file...' 2>&1
exit 1
fi
if [ "x$DISPLAY" = "x" ]
then
sam="/tmp/.sam.$USER"
else
if [ "$DISPLAY" = ":0" ]
then
DISPLAY=:0.0
fi
sam="/tmp/.sam.$USER.$DISPLAY"
fi
if [ ! -p $sam ]
then
pwd="`pwd`"
for i
do
plumb -s B -d edit $i
done
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