diff --git a/README.md b/README.md index 7fb05ef02c2c..f36187fb7e10 100644 --- a/README.md +++ b/README.md @@ -67,6 +67,12 @@ to package it as their default version of ksh93. To build ksh with a custom configuration of features, edit [`src/cmd/ksh93/SHOPT.sh`](https://github.com/ksh93/ksh/blob/dev/src/cmd/ksh93/SHOPT.sh). +On systems such as NetBSD and OpenBSD, where `/bin/ksh` is not ksh93 and the +preinstalled `/etc/ksh.kshrc` profile script is incompatible with ksh93, you'll +want to disable `SHOPT_SYSRC` to avoid loading it on startup -- unless you can +edit it to make it compatible with ksh93. This geneerally involves differences +in the declaration and usage of local variables in functions. + Then `cd` to the top directory and run: ``` diff --git a/src/cmd/ksh93/Mamfile b/src/cmd/ksh93/Mamfile index 6f43b554c9f8..4cd55a99abe6 100644 --- a/src/cmd/ksh93/Mamfile +++ b/src/cmd/ksh93/Mamfile @@ -118,11 +118,6 @@ make install virtual exec - -zutalors) exec - writedef PRINTF_LEGACY 1 ;; exec - esac ;; - exec - 'SYSRC=') - exec - # if one of these exists, make SHOPT_SYSRC load /etc/ksh.kshrc by default - exec - if test -f /etc/ksh.kshrc || test -f /etc/bash.bashrc - exec - then writedef SYSRC 1 - exec - fi ;; exec - # some other SHOPTs may be probed for using feature tests in features/options exec - *=?*) exec - writedef "$n" "$v" ;; diff --git a/src/cmd/ksh93/README b/src/cmd/ksh93/README index 229f66d99c49..f9c1e6a8f944 100644 --- a/src/cmd/ksh93/README +++ b/src/cmd/ksh93/README @@ -146,9 +146,8 @@ The options have the following defaults and meanings: STATS on Add .sh.stats compound variable. - SYSRC Source /etc/ksh.kshrc on initializing an interactive - shell. This is on by default if /etc/ksh.kshrc or - /etc/bash.bashrc exists at compile time. + SYSRC on Source /etc/ksh.kshrc on initializing an interactive + shell. TEST_L Add 'test -l' as an alias for 'test -L'. This is on by default if the OS's external 'test' command supports it. diff --git a/src/cmd/ksh93/SHOPT.sh b/src/cmd/ksh93/SHOPT.sh index 476a60ba4db5..bdf17ea5548b 100644 --- a/src/cmd/ksh93/SHOPT.sh +++ b/src/cmd/ksh93/SHOPT.sh @@ -36,7 +36,7 @@ SHOPT REMOTE= # enable --rc if running as a remote shell SHOPT SCRIPTONLY=0 # build ksh for running scripts only; compile out the interactive shell SHOPT SPAWN= # use spawnveg for fork/exec SHOPT STATS=1 # add .sh.stats variable -SHOPT SYSRC= # attempt . /etc/ksh.kshrc if interactive +SHOPT SYSRC=1 # attempt . /etc/ksh.kshrc if interactive SHOPT TEST_L= # add 'test -l' as an alias for 'test -L' SHOPT TIMEOUT= # number of seconds for shell timeout SHOPT VSH=1 # vi edit mode