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 ?.rc */?.rc */?.out) prompt=('broken! ' ' ')
13 if(flag p) path=(/bin)
14 if not{
15 finit
16 if(~ $#path 0) {
17 path=(/bin /usr/bin)
18 . <{sh -c 'echo $PATH |
19 sed "s/^/path=(''/; s/$/'')/; s/:/'' ''/g"'}
20 }
21 }
22 fn sigexit
23 if(! ~ $#cflag 0){
24 if(flag l && test -r $home/lib/profile) . $home/lib/profile
25 status=''
26 eval $cflag
27 }
28 if not if(flag i){
29 if(~ $TERM 9term){
30 if(~ $#'fn#cd' 0)
31 fn cd { builtin cd $1 && label `{pwd} }
32 }
33 if(flag l && /bin/test -r $home/lib/profile) . $home/lib/profile
34 status=''
35 if(! ~ $#* 0) . $*
36 . -i '/dev/stdin'
37 }
38 if not if(~ $#* 0) . '/dev/stdin'
39 if not{
40 status=''
41 . $*
42 }
43 exit $status