aboutsummaryrefslogtreecommitdiff
path: root/bin/B
blob: c1a4b163b73b2d7bc3056a03fd487d4d522f83a1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/sh

if [ $# -eq 0 ]
then
	echo 'usage: B cmd...' 2>&1
	exit 1
fi

if [ "x$DISPLAY" = "x" ]
then
	sam="/tmp/.sam.$USER"
else
	sam="/tmp/.sam.$USER.$DISPLAY"
fi

if [ ! -p $sam ]
then
	echo could not find sam 2>&1
	exit 2
else
	pwd=`pwd`
	for i
	do
		case $i in
		/*)
			echo "B $i" >>$sam
			;;
		*)
			echo "B $pwd/$i" >>$sam
			;;
		esac
	done
fi