------------------------------------------------------------------------------- Default Environment Set by Shells... Find out what environment a shell defines by default... env - {shell} -c '/usr/bin/env' Sh: ---no extra environment defines--- Ksh: PWD _ Csh: PWD USER Tcsh: PWD USER SHLVL LOGNAME GROUP VENDOR REMOTEHOST HOST HOSTTYPE OSTYPE MACHTYPE Zsh: PWD HOME LOGNAME SHLVL OLDPWD _ Bash: PWD SHELL SHLVL HOSTNAME MACHTYPE OSTYPE OLDPWD _ ------------------------------------------------------------------------------- Environment handling by shells Bourne shell just marks variables as being exported or not exported. Changing an exported variable also changes the value being exported. However if you change a variable that has NOT been marked for export IN THAT SHELL, a local copy is maintained and used and the change is not exported (the original export variable is). The 'set' command only lists variables that have been 'set' within the current shell, not the imported environment variables. IE it will show a changed environment variable. Csh maintains two completely separate lists of variables for local and environmental purposes. The local variable list overrides the environmental when there is a clash. A few variables (like path) are linked to their environmental counterparts (ie, PATH). ------------------------------------------------------------------------------- Bourne Shell -- remove PATH component (or MANPATH or LD_LIBRARY_PATH) LD_LIBRARY_PATH=`echo "$LD_LIBRARY_PATH" | sed 's|/opt/SUNWdxlib/[^:]*||g; s|:::*|:|g; s|^:||; s|:$||;'` export LD_LIBRARY_PATH echo "LD_LIBRARY_PATH = $LD_LIBRARY_PATH" -------------------------------------------------------------------------------