Korn shell in login mode says: $ ksh -l ksh: /etc/profile[7]: source: not found The line 7 is: source /etc/profile.env it works for Bash/zsh but not for vanilla ksh. Guess it should be replaced by: . /etc/profile.env Reproducible: Always Steps to Reproduce: 1. run KornShell in login mode as ksh -l 2. see error message from /etc/profile Actual Results: /etc/profile will be not used by ksh, but it still runs all right. Expected Results: obviously I expect no error messages.
Please check if the following patch to /etc/profile works with ksh: ------------------------------------------------------------------------ Index: profile =================================================================== RCS file: /home/cvsroot/gentoo-src/rc-scripts/etc/profile,v retrieving revision 1.15 diff -u -b -B -r1.15 profile --- profile 18 Nov 2002 19:39:22 -0000 1.15 +++ profile 16 Feb 2003 23:22:48 -0000 @@ -3,13 +3,13 @@ if [ -e "/etc/profile.env" ] then - source /etc/profile.env + . /etc/profile.env fi -#077 would be more secure, but 022 is generally quite realistic +# 077 would be more secure, but 022 is generally quite realistic umask 022 -if [ `/usr/bin/whoami` = 'root' ] +if [ "`/usr/bin/whoami`" = 'root' ] then if [ "$SHELL" = '/bin/bash' ] || [ "$SHELL" = '/bin/sh' ] then @@ -25,6 +25,37 @@ fi unset ROOTPATH -if [ -z "$INPUTRC" -a ! -f "$HOME/.inputrc" ]; then +if [ -z "$INPUTRC" -a ! -f "$HOME/.inputrc" ] +then export INPUTRC="/etc/inputrc" fi + +# Extract the value of EDITOR +get_editor() { + [ ! -f "$1" ] && return + + local editor="`gawk ' + /^[[:space:]]*EDITOR[[:space:]]*=/ { + + sub(/^[[:space:]]*EDITOR[[:space:]]*=/, "") + EDITOR = $0 + } + + END { print EDITOR } + ' $1`" + + bash -c "eval echo $editor" +} + +if [ -f /etc/rc.conf -a -n "`get_editor /etc/rc.conf`" ] +then + export EDITOR="`get_editor /etc/rc.conf`" + +elif [ -f /etc/conf.d/basic -a -n "`get_editor /etc/conf.d/basic`" ] +then + export EDITOR="`get_editor /etc/conf.d/basic`" + +else + export EDITOR="/bin/nano" +fi +
It looks good, the patch works fine to me. Thanks!
Fixed in baselayout-1.8.6.4.