blob: 1d8df2477ce5dddede23a45353009f22985585f4 [file] [log] [blame]
rscb9b5cea2003-10-11 03:55:45 +00001#!/bin/sh
2
rscf063dad2004-02-29 22:42:33 +00003files=""
4dest=""
5
rscb9b5cea2003-10-11 03:55:45 +00006if [ $# -eq 0 ]
7then
rsc669250d2003-12-03 22:50:48 +00008 echo 'usage: B file...' 2>&1
rscb9b5cea2003-10-11 03:55:45 +00009 exit 1
10fi
11
12if [ "x$DISPLAY" = "x" ]
13then
14 sam="/tmp/.sam.$USER"
15else
rsc669250d2003-12-03 22:50:48 +000016 if [ "$DISPLAY" = ":0" ]
17 then
18 DISPLAY=:0.0
19 fi
rscb9b5cea2003-10-11 03:55:45 +000020 sam="/tmp/.sam.$USER.$DISPLAY"
21fi
22
23if [ ! -p $sam ]
24then
rsc88f2c3b2004-04-19 05:51:41 +000025 pwd="`pwd`"
rscf063dad2004-02-29 22:42:33 +000026 for i
27 do
rsce18c1342004-04-23 06:51:06 +000028 i=`cleanname -d "$pwd" "$i"`
29 plumb -s B -d edit "$i"
rscf063dad2004-02-29 22:42:33 +000030 done
rscb9b5cea2003-10-11 03:55:45 +000031else
rscb9b5cea2003-10-11 03:55:45 +000032 for i
33 do
rscdbd7b9a2003-11-23 18:29:08 +000034 pwd=`pwd`
35 file=`cleanname -d $pwd $i`
rsce89321a2003-12-02 21:57:32 +000036 line=`echo $file | sed 's/.*://'`
37 file=`echo $file | sed 's/:.*//'`
rscdbd7b9a2003-11-23 18:29:08 +000038 echo "B $file" >>$sam
rsce89321a2003-12-02 21:57:32 +000039 if [ "x$line" != "x" -a "x$line" != "x$file" ]
40 then
41 echo "$line" >> $sam
42 fi
rscb9b5cea2003-10-11 03:55:45 +000043 done
44fi