Blob


1 # rcmain: Plan 9 on Unix version
2 if(~ $#home 0) home=$HOME
3 if(~ $#home 0) home=/
4 if(~ $#ifs 0) ifs='
5 '
6 switch($#prompt){
7 case 0
8 prompt=('% ' ' ')
9 case 1
10 prompt=($prompt ' ')
11 }
12 if(~ $rcname ?.out) prompt=('broken! ' ' ')
13 if(flag p) path=/bin
14 if not{
15 finit
16 if(~ $#path 0) . <{/bin/sh -c 'echo $PATH |
17 sed "s/^/path=(''/; s/$/'')/; s/:/'' ''/g"'}
18 }
19 fn sigexit
20 if(! ~ $#cflag 0){
21 if(flag l && /bin/test -r $home/lib/profile) . $home/lib/profile
22 status=''
23 eval $cflag
24 }
25 if not if(flag i){
26 if(~ $TERM 9term && ~ $#'fn#cd' 0) fn cd { builtin cd $1 && label `{pwd} }
27 if(flag l && /bin/test -r $home/lib/profile) . $home/lib/profile
28 status=''
29 if(! ~ $#* 0) . $*
30 . -i '/dev/stdin'
31 }
32 if not if(~ $#* 0) . '/dev/stdin'
33 if not{
34 status=''
35 . $*
36 }
37 exit $status