jehanne/arch/rc/lib/rcmain

35 lines
579 B
Plaintext
Raw Normal View History

# rcmain: Plan 9 version
if(~ $#HOME 0) HOME=/
if(~ $#IFS 0) IFS='
'
switch($#PROMPT){
case 0
PROMPT=('% ' ' ')
case 1
PROMPT=($PROMPT ' ')
}
if(~ $rcname ?.out) PROMPT=('broken! ' ' ')
if(flag p) PATH=/cmd
if not{
finit
if(~ $#PATH 0) PATH=(/cmd .)
}
fn sigexit
2017-10-20 00:14:43 +02:00
if(! ~ $#rccmd 0){
if(flag l && /cmd/test -r $HOME/lib/profile) . $HOME/lib/profile
STATUS=''
2017-10-20 00:14:43 +02:00
eval $rccmd
}
if not if(flag i){
if(flag l && /cmd/test -r $HOME/lib/profile) . $HOME/lib/profile
STATUS=''
if(! ~ $#* 0) . $*
. -i '#d/0'
}
if not if(~ $#* 0) . '#d/0'
if not{
STATUS=''
. $*
}
exit $STATUS