various shell script fixes.
add 9a, 9c, 9l wrapper scripts. label sets label on xterm/9term
This commit is contained in:
parent
97a5e5f2dd
commit
dbd7b9a97e
7 changed files with 80 additions and 11 deletions
9
bin/9a
Executable file
9
bin/9a
Executable file
|
|
@ -0,0 +1,9 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
if [ $# != 1 ]; then
|
||||||
|
echo 'usage: 9a file.s' 1>&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
out=`echo $1 | sed 's/\.s$//;s/$/.o/'`
|
||||||
|
exec as -o $out $1
|
||||||
33
bin/9c
Executable file
33
bin/9c
Executable file
|
|
@ -0,0 +1,33 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
usegcc()
|
||||||
|
{
|
||||||
|
cc=gcc
|
||||||
|
cflags=" \
|
||||||
|
-O2 \
|
||||||
|
-I$PLAN9/include \
|
||||||
|
-c \
|
||||||
|
-ggdb \
|
||||||
|
-Wall \
|
||||||
|
-Wno-parentheses \
|
||||||
|
-Wno-missing-braces \
|
||||||
|
-Wno-switch \
|
||||||
|
"
|
||||||
|
}
|
||||||
|
|
||||||
|
cc=none
|
||||||
|
tag="`uname`-`uname -m`-${CC:-cc}"
|
||||||
|
case "$tag" in
|
||||||
|
*BSD*) usegcc ;;
|
||||||
|
*Darwin*) usegcc ;;
|
||||||
|
*HP-UX*) cc=cc; cflags="-g -O -c -Ae" ;;
|
||||||
|
*Linux*) usegcc ;;
|
||||||
|
*OSF1*) cc=cc; cflags="-g -O -c" ;;
|
||||||
|
*SunOS*-cc) cc=cc; cflags="-g -O -c -xCC -D__sun__" ;;
|
||||||
|
*SunOS*-gcc) usegcc ;;
|
||||||
|
*)
|
||||||
|
echo 9c does not know how to compile on "$tag" 1>&2
|
||||||
|
exit 1
|
||||||
|
esac
|
||||||
|
|
||||||
|
exec cc $cflags "$@"
|
||||||
26
bin/9l
Executable file
26
bin/9l
Executable file
|
|
@ -0,0 +1,26 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
ld=none
|
||||||
|
extralibs=-lm
|
||||||
|
tag="`uname`-`uname -m`-${CC:-cc}"
|
||||||
|
case "$tag" in
|
||||||
|
*FreeBSD*) ld=gcc ;;
|
||||||
|
*BSD*) ld=gcc ;;
|
||||||
|
*Linux*) ld=gcc ;;
|
||||||
|
*Darwin*) ld=gcc ;;
|
||||||
|
*SunOS*-cc) ld=cc; extralibs="$extralibs -lrt -lpthread" ;;
|
||||||
|
*SunOS*-gcc) ld=gcc ;;
|
||||||
|
*)
|
||||||
|
echo do not know how to link on "$tag" 1>&2
|
||||||
|
exit 1
|
||||||
|
esac
|
||||||
|
|
||||||
|
case $ld in
|
||||||
|
gcc)
|
||||||
|
exec gcc \
|
||||||
|
-ggdb \
|
||||||
|
-L$PLAN9/lib \
|
||||||
|
"$@" \
|
||||||
|
$extralibs
|
||||||
|
;;
|
||||||
|
esac
|
||||||
12
bin/B
12
bin/B
|
|
@ -18,16 +18,10 @@ then
|
||||||
echo could not find sam 2>&1
|
echo could not find sam 2>&1
|
||||||
exit 2
|
exit 2
|
||||||
else
|
else
|
||||||
pwd=`pwd`
|
|
||||||
for i
|
for i
|
||||||
do
|
do
|
||||||
case $i in
|
pwd=`pwd`
|
||||||
/*)
|
file=`cleanname -d $pwd $i`
|
||||||
echo "B $i" >>$sam
|
echo "B $file" >>$sam
|
||||||
;;
|
|
||||||
*)
|
|
||||||
echo "B $pwd/$i" >>$sam
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ B "$@"
|
||||||
while true
|
while true
|
||||||
do
|
do
|
||||||
nstat=`ls -l $1`
|
nstat=`ls -l $1`
|
||||||
if [ "$stat" eq "$nstat" ]
|
if [ "x$stat" != "x$nstat" ]
|
||||||
then
|
then
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
7
bin/label
Executable file
7
bin/label
Executable file
|
|
@ -0,0 +1,7 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
label() {
|
||||||
|
echo "$@" | awk '{printf("\033];%s\007", $0);}'
|
||||||
|
}
|
||||||
|
|
||||||
|
label "$@"
|
||||||
2
bin/ps
2
bin/ps
|
|
@ -66,7 +66,7 @@ function statestr(s)
|
||||||
!
|
!
|
||||||
|
|
||||||
/bin/ps -axww -o 'user,pid,start,time,vsz,stat,command' | sed 1d |
|
/bin/ps -axww -o 'user,pid,start,time,vsz,stat,command' | sed 1d |
|
||||||
awk -f /tmp/awk.xxx$$ | sort +1 -n
|
awk -f /tmp/awk.xxx$$ | sort -n +1
|
||||||
|
|
||||||
rm -f /tmp/awk.xxx$$
|
rm -f /tmp/awk.xxx$$
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue