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