tExtra sam scripts. - plan9port - [fork] Plan 9 from user space
HTML git clone git://src.adamsgaard.dk/plan9port
DIR Log
DIR Files
DIR Refs
DIR README
DIR LICENSE
---
DIR commit b9b5cea4eda1c011cfc2e18c8b89987d4298cb7c
DIR parent 00b80edb976f338a22fa8140b11e4b66c79b28d2
HTML Author: rsc <devnull@localhost>
Date: Sat, 11 Oct 2003 03:55:45 +0000
Extra sam scripts.
Diffstat:
A bin/B | 33 +++++++++++++++++++++++++++++++
A bin/samsave | 18 ++++++++++++++++++
2 files changed, 51 insertions(+), 0 deletions(-)
---
DIR diff --git a/bin/B b/bin/B
t@@ -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
DIR diff --git a/bin/samsave b/bin/samsave
t@@ -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
+