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