commit 2c500adda28bdf7187de272a50fc1f37fe467160 from: rsc date: Tue Jan 11 17:49:03 2005 UTC remove references to hardcoded /usr/local/plan9 where possible commit - b8f742db850ffc99333a97ab54fc820c6de0fd98 commit + 2c500adda28bdf7187de272a50fc1f37fe467160 blob - d7f7ad237ff6a2f45971de6aa0701e1b4e41cda9 blob + da94c3e2fc97d7abc859c767155a45bae839cd72 --- bin/" +++ bin/" @@ -1,4 +1,4 @@ -#!/usr/local/plan9/bin/rc +#!/usr/bin/env $PLAN9/bin/rc fn text { if(~ $winid [0-9]*) blob - ac5cda8bf2054338f0cec25df31702eadd12ce14 blob + 9a6d5a5064e710beff5501311af83415900f3059 --- bin/"" +++ bin/"" @@ -1,4 +1,4 @@ -#!/usr/local/plan9/bin/rc +#!/usr/bin/env $PLAN9/bin/rc PROMPT='[^ ]*[%;$#][ ]+' blob - 5b8391793a468dba06edbe86daf4c80442210d9c blob + d7b8ae14316160e7208d884294cf4fcd999f228b --- bin/Getdir +++ bin/Getdir @@ -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 blob - 2d8156dfa4f6a36aaff2205150a97a96084efa0d blob + 74d710ed952b0b9d30f2b877b5a07b4908a3beb4 --- bin/adict +++ bin/adict @@ -1,4 +1,4 @@ -#!/usr/local/plan9/bin/rc +#!/usr/bin/env $PLAN9/bin/rc . $PLAN9/lib/acme.rc blob - df72db883cf69f9f27a1f5281b4b8f797cb488b2 blob + 3d720b8d5fb219520486690888e71a715ceed6a1 --- bin/doctype +++ 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 blob - c9e8b92976d5c82247fa4c0918cda240a2262595 blob + b50b51906ddf339a3c35caacf8cc246f808dc455 --- bin/g +++ bin/g @@ -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 blob - 57e8d3ccd44017b593468d2fc7c6e86b4bcdf804 blob + 12223be8d54c0f76200da82b3cb344c8cebdbae4 --- bin/lookman +++ 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 blob - 3a6b4a3e707d4986cf34ef203f383975bf569140 blob + f09538bdcf790a689cff6f434312ab28b5c856d7 --- bin/spell +++ bin/spell @@ -1,4 +1,4 @@ -#!/usr/local/plan9/bin/rc +#!/usr/bin/env $PLAN9/bin/rc spellflags=() deroffargs=() blob - 046417a077a6a8f953162237ffd9cc5a393fc4b5 blob + ffacc5e6abd68d459eecdc49ba6b68e3fe8f44d2 --- bin/src +++ bin/src @@ -1,4 +1,4 @@ -#!/usr/local/plan9/bin/rc +#!/usr/bin/env $PLAN9/bin/rc sym = 'threadmain?z p9main?z blob - 147f387b22d054e15fd8bd1321ce77f53b5a41fd blob + e45a9fa52d2d7427580eab79d0184b011114f51e --- bin/start +++ bin/start @@ -1,3 +1,3 @@ #!/bin/sh -exec /usr/local/plan9/bin/kill -CONT "$@" +exec $PLAN9/bin/kill -CONT "$@" blob - cbafb9da788295b6d11481745129e53cb5f4543f blob + b54a1bd5deb3e440ee667069ec421ed2c28c447a --- bin/stop +++ bin/stop @@ -1,3 +1,3 @@ #!/bin/sh -exec /usr/local/plan9/bin/kill -STOP "$@" +exec $PLAN9/bin/kill -STOP "$@"