-
Notifications
You must be signed in to change notification settings - Fork 326
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Includes work to increase portability on *nix systems by cinap_lenrek, some extensions to the syntax, and multiple bug fixes to: - lexer/interpreter - globber - heredoc and much more.
- Loading branch information
Showing
33 changed files
with
3,716 additions
and
3,002 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Oops, something went wrong.