xref: /plan9/sys/src/cmd/rc/rcmain.unix (revision bad30d5d5a5510556b3d04cddb2a7590f26fb546)
1# rcmain: unix version
2if(~ $#home 0) home=$HOME
3if(~ $#ifs 0) ifs='
4'
5switch($#prompt){
6case 0
7	prompt=('% ' '	')
8case 1
9	prompt=($prompt '	')
10}
11if(~ $rcname ?.out) prompt=('broken! ' '	')
12if(flag p) path=/bin
13if not {
14	finit
15	if(~ $#path 0) path=(. /bin /usr/bin /usr/local/bin)
16}
17fn sigexit
18if(! ~ $#cflag 0){
19	if(flag l && test -r $home/lib/profile) . $home/lib/profile
20	status=''
21	eval $cflag
22}
23if not if(flag i){
24	if(flag l && test -r $home/lib/profile) . $home/lib/profile
25	status=''
26	if(! ~ $#* 0) . $*
27	. -i /dev/fd/0
28}
29if not if(~ $#* 0) . /dev/fd/0
30if not{
31	status=''
32	. $*
33}
34exit $status
35