Blob
1 # rcmain: Plan 9 on Unix version2 if(~ $#home 0) home=$HOME3 if(~ $#home 0) home=/4 if(~ $#ifs 0) ifs='5 '6 switch($#prompt){7 case 08 prompt=('% ' ' ')9 case 110 prompt=($prompt ' ')11 }12 if(~ $rcname ?.out ?.rc */?.rc */?.out) prompt=('broken! ' ' ')13 if(flag p) path=(/bin /usr/bin)14 if not{15 finit16 # should be taken care of by rc now, but leave just in case17 }18 fn sigexit19 if(! ~ $#cflag 0){20 if(flag l && test -r $home/lib/profile) . $home/lib/profile21 status=''22 eval $cflag23 }24 if not if(flag i){25 if(~ $TERM 9term){26 if(~ $#'fn#cd' 0)27 fn cd { builtin cd $1 && flag i && awd }28 awd29 }30 if(flag l && test -r $home/lib/profile) . $home/lib/profile31 status=''32 if(! ~ $#* 0) . $*33 . -i '/dev/stdin'34 }35 if not if(~ $#* 0) . '/dev/stdin'36 if not{37 status=''38 . $*39 }40 exit $status