diff options
-rwxr-xr-x | bin/" | 2 | ||||
-rwxr-xr-x | bin/"" | 2 | ||||
-rwxr-xr-x | bin/Getdir | 2 | ||||
-rwxr-xr-x | bin/adict | 2 | ||||
-rwxr-xr-x | bin/doctype | 2 | ||||
-rwxr-xr-x | bin/g | 48 | ||||
-rwxr-xr-x | bin/lookman | 6 | ||||
-rwxr-xr-x | bin/spell | 2 | ||||
-rwxr-xr-x | bin/src | 2 | ||||
-rwxr-xr-x | bin/start | 2 | ||||
-rwxr-xr-x | bin/stop | 2 |
11 files changed, 45 insertions, 27 deletions
@@ -1,4 +1,4 @@ -#!/usr/local/plan9/bin/rc +#!/usr/bin/env $PLAN9/bin/rc fn text { if(~ $winid [0-9]*) @@ -1,4 +1,4 @@ -#!/usr/local/plan9/bin/rc +#!/usr/bin/env $PLAN9/bin/rc PROMPT='[^ ]*[%;$#][ ]+' @@ -1,4 +1,4 @@ -#!/usr/local/plan9/bin/rc +#!/usr/bin/env $PLAN9/bin/rc # Click on an acme directory window and then execute Getdir @@ -1,4 +1,4 @@ -#!/usr/local/plan9/bin/rc +#!/usr/bin/env $PLAN9/bin/rc . $PLAN9/lib/acme.rc diff --git a/bin/doctype b/bin/doctype index df72db88..3d720b8d 100755 --- a/bin/doctype +++ b/bin/doctype @@ -1,4 +1,4 @@ -#!/usr/local/plan9/bin/rc +#!/usr/bin/env $PLAN9/bin/rc # doctype: synthesize proper command line for troff troff=troff @@ -1,19 +1,37 @@ -#!/usr/local/plan9/bin/rc +#!/bin/sh -flags=() -while(! ~ $#* 1 && ~ $1 -*){ - flags=($flags $1) - shift -} +inflags=yes +flags="" +while [ $# != 0 -a $inflags = yes ] +do + case "$1" in + -*) + flags="$flags $1" + shift + ;; + -) + inflags=no + shift + ;; + *) + inflags=no + ;; + esac +done -switch($#*){ -case 0 - echo 'usage: g [flags] pattern [files]' >[1=2] +case $# in +0) + echo 1>&2 'usage: g [flags] pattern [files]' 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 -} + ;; +1) + pattern="$1" + files=`/bin/ls *.[bcChm] *.cc *.py *.tex *.ms *.java 2>/dev/null` + ;; +*) + pattern="$1" + shift + files="$@" +esac +exec grep -n $flags -- "$pattern" $files /dev/null diff --git a/bin/lookman b/bin/lookman index 57e8d3cc..12223be8 100755 --- a/bin/lookman +++ b/bin/lookman @@ -1,7 +1,7 @@ -#!/usr/local/plan9/bin/rc +#!/usr/bin/env $PLAN9/bin/rc # Usage: lookman key ... # prints out the names of all manual pages containing all the given keywords -index=/usr/local/plan9/man/lookman.index +index=$PLAN9/man/lookman.index t1=/tmp/look1.$pid t2=/tmp/look2.$pid fn sigexit sigint sighup sigterm{ @@ -24,7 +24,7 @@ for(i in $*){ ' > $t2 mv $t2 $t1 } -sort $t1 | sed 's;/usr/local/plan9/man/man[0-9]*/;; +sort $t1 | sed 's;/.*/man/man[0-9]*/;; s;(.*)\.(.*);man \2 \1 # \1(\2);' rm -f $t1 $t2 exit 0 @@ -1,4 +1,4 @@ -#!/usr/local/plan9/bin/rc +#!/usr/bin/env $PLAN9/bin/rc spellflags=() deroffargs=() @@ -1,4 +1,4 @@ -#!/usr/local/plan9/bin/rc +#!/usr/bin/env $PLAN9/bin/rc sym = 'threadmain?z p9main?z @@ -1,3 +1,3 @@ #!/bin/sh -exec /usr/local/plan9/bin/kill -CONT "$@" +exec $PLAN9/bin/kill -CONT "$@" @@ -1,3 +1,3 @@ #!/bin/sh -exec /usr/local/plan9/bin/kill -STOP "$@" +exec $PLAN9/bin/kill -STOP "$@" |