Files
cdesktop/cde/programs/dtlogin/config/0060.dtsysenv.src
Marcin Cieslak 17a33f0430 Use KORNSHELL variable instead of /bin/ksh
This patch removes instances of hardcoded
invocation of /bin/ksh and allows to
replace it with, for, example,
/usr/local/bin/ksh93

Also "ksh93" is accepted whenever "ksh" is.

Tested using the following /bin/ksh:

----8<----
WHAT=`ps -o command= -p $PPID`
msg="Something tried to call /bin/ksh: $PPID: $WHAT"
print -u2 "$msg"
logger user.warn "$msg"
exit 99
----8<----
(Warning: first two lines are FreeBSD specific)

Scripts from Makefiles should now be executed either
with

$(KORNSHELL) korn-shell-script

or

$(SHELL) bourne-shell-script

therefore #!/bin/ksh has not been changed everywhere.

/usr/dt/bin/ scripts have been converted (e.g. Xsession)

Whenever possible Imake and CPP facilities have been used.

For C and C++ programs KORNSHELL needs to be defined to
"/path/to/your/ksh" (with quotes) so that it can make
a valid C constant.

Therefore, when adding KORNSHELL to Imakefile for C files,
you have to add

CXXEXTRA_DEFINES = -DKORNSHELL=\"$(KORNSHELL)\"

or similar (for example, see programs/dtprintinfo)

But for simple shell script substitution we usually change

 LOCAL_CPP_DEFINES = -DCDE_CONFIGURATION_TOP=$(CDE_CONFIGURATION_TOP) \
                     -DCDE_INSTALLATION_TOP=$(CDE_INSTALLATION_TOP) \
                     -DCDE_LOGFILES_TOP=$(CDE_LOGFILES_TOP)

to:

 LOCAL_CPP_DEFINES = -DCDE_CONFIGURATION_TOP=$(CDE_CONFIGURATION_TOP) \
                     -DCDE_INSTALLATION_TOP=$(CDE_INSTALLATION_TOP) \
                     -DCDE_LOGFILES_TOP=$(CDE_LOGFILES_TOP) \
                     -DKORNSHELL=$(KORNSHELL) \
                     -DXPROJECTROOT=X11ProjectRoot

since we don't want quotes for shell scripts.
2012-08-23 20:00:43 -06:00

61 lines
1.7 KiB
Plaintext

XCOMM !KORNSHELL
XCOMM ####################################################################
XCOMM ## File: 0060.srcsysenv
XCOMM ##
XCOMM ## Default Location: /usr/dt/config/Xsession.d/
XCOMM ##
XCOMM ## Purpose: Source system-defined environment variables
XCOMM ##
XCOMM ## Description:
XCOMM ## This script is invoked by means of the Xsession
XCOMM ## file at user login.
XCOMM ##
XCOMM ## Invoked by: /usr/dt/bin/Xsession
XCOMM ##
XCOMM ## $TOG: 0060.srcsysenv.src /main/1 1998/08/03 18:10:08 devobj $
XCOMM ##
XCOMM ## (c) Copyright 1993, 1994 Hewlett-Packard Company
XCOMM ## (c) Copyright 1993, 1994 International Business Machines Corp.
XCOMM ## (c) Copyright 1993, 1994 Sun Microsystems, Inc.
XCOMM ## (c) Copyright 1993, 1994 Unix System Labs, Inc., a subsidiary of
XCOMM ## (c) Copyright 1993, 1994 Novell, Inc.
XCOMM ##
XCOMM ####################################################################
XCOMM ##
XCOMM ####################################################################
#define HASH #
HASH
HASH Source TIMEZONE
HASH
TZ_FILE=/etc/TIMEZONE
if [ -f $TZ_FILE -a -r $TZ_FILE ]; then
. $TZ_FILE
fi
unset TZ_FILE
HASH
HASH Source PATH - it does NOT set the variable so this
HASH this script must take of it
HASH
PATH_FILE=/etc/PATH
if [ -f $PATH_FILE -a -r $PATH_FILE ]; then
export PATH="$PATH:`cat $PATH_FILE`"
fi
unset PATH_FILE
HASH
HASH Source MANPATH - it does NOT set the variable so this
HASH this script must take of it
HASH
MANPATH_FILE=/etc/MANPATH
if [ -f $MANPATH_FILE -a -r $MANPATH_FILE ]; then
export MANPATH="$MANPATH:`cat $MANPATH_FILE`"
fi
unset MANPATH_FILE
XCOMM ######################### eof #####################