commit 3a9ee6351914b85db336d51b0e450f954d37d7a6 from: rsc date: Fri Jan 14 05:42:53 2005 UTC must let $PLAN9 be overrided in 9 and 9.rc commit - 67075c3634c316ce9cc0e6fa88e65ca27503abc4 commit + 3a9ee6351914b85db336d51b0e450f954d37d7a6 blob - ff1a928dbd1c5db2710c7937f6dece615c6b26f2 blob + 33b0d89cd0936db4637753f2f37b4e8cb5eb5ed4 --- bin/9 +++ bin/9 @@ -1,7 +1,13 @@ #!/bin/sh -export PLAN9=/usr/local/plan9 -export PATH=$PLAN9/bin:$PATH +export PLAN9=${PLAN9:-/usr/local/plan9} +case "$PATH" in +$PLAN9/bin:*) + ;; +*) + export PATH=$PLAN9/bin:$PATH + ;; +esac case $# in [1-9]*) blob - 1fb75d23127708d80881584bc7425215332ecdb7 blob + 354976d31307df35833445e19ef21ff8b59715e9 --- bin/9.rc +++ bin/9.rc @@ -1,6 +1,7 @@ #!/usr/local/plan9/bin/rc -PLAN9=/usr/local/plan9 +if(~ $#PLAN9 0) + PLAN9=/usr/local/plan9 if(! ~ $path(1) $PLAN9/bin) path=($PLAN9/bin $path) blob - 80d5470505d973a4af7ed9d56368c919bc9553c5 blob + f3e57ee6dfc9866207d4f4aa62bc63ebe10b3589 --- man/man1/9.1 +++ man/man1/9.1 @@ -41,6 +41,7 @@ is a shell script that sets up a Plan 9 environment an .I cmd . It sets .B $PLAN9 +if necessary and adds .B $PLAN9/bin to the beginning of @@ -50,7 +51,7 @@ before running .PP If run with no arguments, .B 9 -does not do anything. This is so that it can be invoked from +does not do anything, so it can be invoked from .IR sh -style shells using .B . @@ -60,7 +61,7 @@ in order to make the current shell start running in th .I 9.rc is the same as .I 9 -but written for the shell +but written for use by the shell .IR rc (1). .SH EXAMPLES Search for greek in the password file: