plan9port/bin/B
rsc 669250d159 Various fixes.
B - fixed usage, DISPLAY :0 vs :0.0
	9term - fixed various terminal things
	rc - notice traps in Read
	_p9dir - only run disk code for disks
	dirread - getdirentries on FreeBSD and Linux
		are different w.r.t. meaning of off.
	notify - set up so signals interrupt system calls
	bprint - use bfmt.
2003-12-03 22:50:48 +00:00

37 lines
527 B
Bash
Executable file

#!/bin/sh
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
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