aboutsummaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorrsc <devnull@localhost>2004-03-25 23:03:22 +0000
committerrsc <devnull@localhost>2004-03-25 23:03:22 +0000
commitcb27443abf3d6af6ab52377c71c843e619928433 (patch)
tree437129c581c3a2fbee75c5e52388b2bcf1cedb5e /bin
parent0023dde3260f4d6b085bed7d90bf8b1ca0daf77b (diff)
downloadplan9port-cb27443abf3d6af6ab52377c71c843e619928433.tar.gz
plan9port-cb27443abf3d6af6ab52377c71c843e619928433.tar.bz2
plan9port-cb27443abf3d6af6ab52377c71c843e619928433.zip
Today's changes.
Diffstat (limited to 'bin')
-rwxr-xr-xbin/9l14
-rwxr-xr-xbin/awd3
-rwxr-xr-xbin/g19
-rwxr-xr-xbin/ps13
-rwxr-xr-xbin/web1
5 files changed, 47 insertions, 3 deletions
diff --git a/bin/9l b/bin/9l
index e510e4d6..a7924e74 100755
--- a/bin/9l
+++ b/bin/9l
@@ -3,12 +3,24 @@
extralibs=-lm
tag="${SYSNAME:-`uname`}-${OBJTYPE:-`uname -m`}"
case "$tag" in
-*FreeBSD*) ld=gcc ;;
+*OpenBSD*) ld=gcc
+ extralibs="$extralibs -lpthread"
+ ;;
*BSD*) ld=gcc ;;
*Linux*) ld=gcc ;;
*Darwin*) ld=gcc ;;
*SunOS*) ld="${CC9:-cc} -g"
extralibs="$extralibs -lrt -lpthread -lsocket -lnsl"
+ # Record paths to shared libraries to avoid needing LD_LIBRARY_PATH
+ for i in "$@"
+ do
+ case "$i" in
+ -L*)
+ s=`echo $i | sed 's/-L/-R/'`
+ extralibs="$extralibs $s"
+ ;;
+ esac
+ done
;;
*)
echo do not know how to link on "$tag" 1>&2
diff --git a/bin/awd b/bin/awd
new file mode 100755
index 00000000..4b1ab78e
--- /dev/null
+++ b/bin/awd
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+label `pwd`
diff --git a/bin/g b/bin/g
new file mode 100755
index 00000000..c9e8b929
--- /dev/null
+++ b/bin/g
@@ -0,0 +1,19 @@
+#!/usr/local/plan9/bin/rc
+
+flags=()
+while(! ~ $#* 1 && ~ $1 -*){
+ flags=($flags $1)
+ shift
+}
+
+switch($#*){
+case 0
+ echo 'usage: g [flags] pattern [files]' >[1=2]
+ exit 1
+case 1
+ 9grep -n $flags -- $1 *.[Cbchm] *.cc *.py *.tex *.ms *.java /dev/null \
+ |[2] {9grep -v '^(grep: can''t open \*|grep: \*\.)' >[1=2]; status=0}
+case *
+ 9grep -n $flags -- $* /dev/null
+}
+
diff --git a/bin/ps b/bin/ps
index 54678eb8..d7e0767f 100755
--- a/bin/ps
+++ b/bin/ps
@@ -15,6 +15,7 @@ BEGIN{
state["I"] = "Idle";
state["J"] = "Jail";
state["R"] = "Ready";
+ state["O"] = "Running";
state["S"] = "Sleep";
state["T"] = "Stopped";
state["Z"] = "Zombie";
@@ -65,8 +66,16 @@ function statestr(s)
}
!
-/bin/ps -axww -o 'user,pid,start,time,vsz,stat,command' | sed 1d |
- awk -f /tmp/awk.xxx$$ | sort -n +1
+case "${SYSNAME:-`uname`}" in
+SunOS)
+ /bin/ps -aA -o 'user,pid,stime,time,vsz,s,args' | sed 1d |
+ nawk -f /tmp/awk.xxx$$ | sort -n +1
+ ;;
+*)
+ /bin/ps -axww -o 'user,pid,start,time,vsz,stat,command' | sed 1d |
+ awk -f /tmp/awk.xxx$$ | sort -n +1
+ ;;
+esac
rm -f /tmp/awk.xxx$$
diff --git a/bin/web b/bin/web
index a597f2da..7ca1c7de 100755
--- a/bin/web
+++ b/bin/web
@@ -10,6 +10,7 @@ plumb1()
;;
*firebird*)
$BROWSER -remote 'openURL('$i', new-window)'
+ ;;
*firefox*)
$BROWSER -remote 'openURL('$i', new-window)'
;;