Blame


1 1379cecf 2003-11-23 devnull # rcmain: Plan 9 on Unix version
2 1379cecf 2003-11-23 devnull if(~ $#home 0) home=$HOME
3 1379cecf 2003-11-23 devnull if(~ $#home 0) home=/
4 1379cecf 2003-11-23 devnull if(~ $#ifs 0) ifs='
5 1379cecf 2003-11-23 devnull '
6 1379cecf 2003-11-23 devnull switch($#prompt){
7 1379cecf 2003-11-23 devnull case 0
8 1379cecf 2003-11-23 devnull prompt=('% ' ' ')
9 1379cecf 2003-11-23 devnull case 1
10 1379cecf 2003-11-23 devnull prompt=($prompt ' ')
11 1379cecf 2003-11-23 devnull }
12 2774920b 2004-03-26 devnull if(~ $rcname ?.out ?.rc */?.rc */?.out) prompt=('broken! ' ' ')
13 f1bfc54e 2004-05-14 devnull if(flag p) path=(/bin /usr/bin)
14 1379cecf 2003-11-23 devnull if not{
15 1379cecf 2003-11-23 devnull finit
16 c8b6342d 2005-01-13 devnull # should be taken care of by rc now, but leave just in case
17 cb27443a 2004-03-25 devnull if(~ $#path 0) {
18 cb27443a 2004-03-25 devnull path=(/bin /usr/bin)
19 1aae7009 2005-01-07 devnull eval `{sh -c 'echo $PATH |
20 1aae7009 2005-01-07 devnull sed "s/^/path=(''/; s/$/'')/; s/:/'' ''/g"'}
21 cb27443a 2004-03-25 devnull }
22 1379cecf 2003-11-23 devnull }
23 1379cecf 2003-11-23 devnull fn sigexit
24 1379cecf 2003-11-23 devnull if(! ~ $#cflag 0){
25 cb27443a 2004-03-25 devnull if(flag l && test -r $home/lib/profile) . $home/lib/profile
26 1379cecf 2003-11-23 devnull status=''
27 1379cecf 2003-11-23 devnull eval $cflag
28 1379cecf 2003-11-23 devnull }
29 1379cecf 2003-11-23 devnull if not if(flag i){
30 5a82f26e 2003-12-02 devnull if(~ $TERM 9term){
31 5a82f26e 2003-12-02 devnull if(~ $#'fn#cd' 0)
32 f1bfc54e 2004-05-14 devnull fn cd { builtin cd $1 && flag i && awd }
33 5a82f26e 2003-12-02 devnull }
34 f1bfc54e 2004-05-14 devnull if(flag l && test -r $home/lib/profile) . $home/lib/profile
35 1379cecf 2003-11-23 devnull status=''
36 1379cecf 2003-11-23 devnull if(! ~ $#* 0) . $*
37 1379cecf 2003-11-23 devnull . -i '/dev/stdin'
38 1379cecf 2003-11-23 devnull }
39 1379cecf 2003-11-23 devnull if not if(~ $#* 0) . '/dev/stdin'
40 1379cecf 2003-11-23 devnull if not{
41 1379cecf 2003-11-23 devnull status=''
42 1379cecf 2003-11-23 devnull . $*
43 1379cecf 2003-11-23 devnull }
44 1379cecf 2003-11-23 devnull exit $status