Blob


1 #!/bin/sh
3 if [ $# -eq 0 ]
4 then
5 echo 'usage: B file...' 2>&1
6 exit 1
7 fi
9 if [ "x$DISPLAY" = "x" ]
10 then
11 sam="/tmp/.sam.$USER"
12 else
13 if [ "$DISPLAY" = ":0" ]
14 then
15 DISPLAY=:0.0
16 fi
17 sam="/tmp/.sam.$USER.$DISPLAY"
18 fi
20 if [ ! -p $sam ]
21 then
22 echo could not find sam 2>&1
23 exit 2
24 else
25 for i
26 do
27 pwd=`pwd`
28 file=`cleanname -d $pwd $i`
29 line=`echo $file | sed 's/.*://'`
30 file=`echo $file | sed 's/:.*//'`
31 echo "B $file" >>$sam
32 if [ "x$line" != "x" -a "x$line" != "x$file" ]
33 then
34 echo "$line" >> $sam
35 fi
36 done
37 fi