mirror of
https://github.com/9fans/plan9port.git
synced 2025-01-12 11:10:07 +00:00
Extra sam scripts.
This commit is contained in:
parent
00b80edb97
commit
b9b5cea4ed
2 changed files with 51 additions and 0 deletions
33
bin/B
Executable file
33
bin/B
Executable file
|
@ -0,0 +1,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
|
18
bin/samsave
Executable file
18
bin/samsave
Executable file
|
@ -0,0 +1,18 @@
|
|||
#!/bin/sh
|
||||
# Copyright (c) 1998 Lucent Technologies - All rights reserved.
|
||||
|
||||
file=$1
|
||||
case "$2" in
|
||||
-f)
|
||||
echo "$file"
|
||||
cat >$file
|
||||
;;
|
||||
"")
|
||||
echo "$file?"
|
||||
read yn </dev/tty
|
||||
case "$yn" in
|
||||
[Yy]*)
|
||||
cat >$file
|
||||
esac
|
||||
esac
|
||||
|
Loading…
Reference in a new issue