Blob
1 #!/bin/sh3 files=""4 dest=""6 line=""7 if [ $# -gt 0 ]; then8 case "$1" in9 +[0-9]*)10 line="`echo $1 | sed 's/+/:/'`"11 shift12 ;;13 esac14 fi16 if [ $# -eq 0 ]17 then18 echo 'usage: B [+line] file...' 2>&119 exit 120 fi22 if [ "x$DISPLAY" = "x" ]23 then24 sam="/tmp/.sam.$USER"25 else26 if [ "$DISPLAY" = ":0" ]27 then28 DISPLAY=:0.029 fi30 sam="/tmp/.sam.$USER.$DISPLAY"31 fi33 if [ ! -p $sam ]34 then35 pwd="`pwd`"36 for i37 do38 i="$i$line"39 i=`cleanname -d "$pwd" "$i"`40 plumb -s B -d edit "$i"41 done42 else43 for i44 do45 i="$i$line"46 pwd=`pwd`47 file=`cleanname -d $pwd $i`48 line=`echo $file | sed 's/.*://'`49 file=`echo $file | sed 's/:.*//'`50 echo "B $file" >>$sam51 if [ "x$line" != "x" -a "x$line" != "x$file" ]52 then53 echo "$line" >> $sam54 fi55 done56 fi