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