Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

import current 9front rc #558

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 17 additions & 30 deletions rcmain
Original file line number Diff line number Diff line change
@@ -1,51 +1,38 @@
# rcmain: Plan 9 on Unix version
# rcmain: unix version
if(~ $#home 0) home=$HOME
if(~ $#home 0) home=/
if(~ $#ifs 0) ifs='
'
profile=$home/.rcrc
switch($#prompt){
case 0
prompt=('% ' ' ')
case 1
prompt=($prompt ' ')
}
if(~ $rcname ?.out ?.rc */?.rc */?.out) prompt=('broken! ' ' ')
if(flag p) path=(/bin /usr/bin)
if not{
if(~ $rcname ?.out) prompt=('broken! ' ' ')
if(flag p) path=/bin
if not {
finit
# should be taken care of by rc now, but leave just in case
if(~ $#path 0) path=(. /bin /usr/bin /usr/local/bin)
}
fn sigexit
if(! ~ $#cflag 0){
if(flag l && test -r $home/lib/profile) . $home/lib/profile
if(flag l) {
. -q $profile
}
status=''
eval $cflag
exit $status
}
if(flag i){
if(~ $termprog 9term || ~ $termprog win){
fn cd {
# builtin cd $1 && flag i && awd
# is not sufficient when running in a subshell
# that is rc -e (like mk uses!)
if(builtin cd $1){
if(flag i) $PLAN9/bin/9 awd || status=''
status=''
}
}
$PLAN9/bin/9 awd
if not if(flag i){
if(flag l) {
. -q $profile
}
if(flag l && test -r $home/lib/profile) . $home/lib/profile
status=''
if(! ~ $#* 0) . $*
. -i '/dev/stdin'
exit $status
. -i /dev/fd/0
}
if(flag l && test -r $home/lib/profile) . $home/lib/profile
if(~ $#* 0){
. /dev/stdin
exit $status
if not if(~ $#* 0) . /dev/fd/0
if not{
status=''
. $*
}
status=''
. $*
exit $status
Loading