Previous Table of Contents Next


Defining Bourne and Korn Shell Environment Variables

To define an environment variable for the Bourne and Korn shells, type VARIABLE =value ;export VARIABLE and press Return:

$ PS1=oak$;export PS1
$

Defining C Shell Environment Variables

To define an environment variable for the C shell, type setenv VARIABLE value and press Return:

% setenv DISPLAY rogue:Ø
%

Displaying Environment Variable Settings

To display a list of the current environment variable settings, type env and press Return:

$ env
HOME=/home/irving
HZ=1ØØ
LOGNAME=irving
MAIL=/var/mail/irving
MANSECTS=1:1m:1c:1f:1s:1b:2:3:3c:3i:3n:3m:3k:3g:3e:3x11:3xt:3w:3b:
9:4:5:7:8
PATH=/usr/bin
SHELL=/bin/sh
TERM=sun
TZ=EST5EDT
$

The following example shows all the environment variables for a system running CDE:

castle% env
MANPATH=/usr/openwin/share/man:/usr/openwin/man:/usr/share/man
:/usr/dt/share/man:/usr/dt/man:/usr/man:/opt/SUNWrtvc/man
DTDATABASESEARCHPATH=/export/home/winsor/.dt/types,/etc/dt/appconfig/
types/
%L,/etc/dt/appconfig/types/C,/usr/dt/appconfig/types/%L,/usr/dt/appconfig
/types/C
DTXSERVERLOCATION=local
LANG=C
HELPPATH=/usr/openwin/lib/locale:/usr/openwin/lib/help
DTSOURCEPROFILE=true
PATH=/usr/openwin/bin:/usr/dt/bin:/bin:/usr/bin:/usr/ucb:/etc:.
AB_CARDCATALOG=/usr/dt/share/answerbooks/C/ab_cardcatalog
DTUSERSESSION=winsor-castle-0
XMICONBMSEARCHPATH=/export/home/winsor/.dt/icons/%B%M.bm:/export/home
/winsor/.dt/icons/%B%M.pm:/export/home/winsor/.dt/icons/
%B:/usr/dt/appconfig/icons/%L/%B%M.bm:/usr/dt/appconfig/icons/
%L/%B%M.pm:/usr/dt/appconfig/icons/%L/%B:/usr/dt/appconfig/icons/
C/%B%M.bm:/usr/dt/appconfig/icons/C/%B%M.pm:/usr/dt/appconfig/icons/
C/%B
SESSION_SVR=castle
OPENWINHOME=/usr/openwin
EDITOR=/usr/dt/bin/dtpad
LOGNAME=winsor
DTSCREENSAVERLIST=StartDtscreenSwarm StartDtscreenQix   StartDtscreenFlame
StartDtscreenHop StartDtscreenImage StartDtscreenLife   StartDtscreenRotor
StartDtscreenPyro StartDtscreenWorm StartDtscreenBlank
MAIL=/var/mail/winsor
USER=winsor
DISPLAY=:0.0
SHELL=/bin/csh
DTAPPSEARCHPATH=/export/home/winsor/.dt/appmanager:/etc/dt
/appconfig/appmanager/%L:/etc/dt/appconfig/appmanager/C
:/usr/dt/appconfig/appmanager/%L:/usr/dt/appconfig/appmanager/C
HOME=/export/home/winsor
XFILESEARCHPATH=/usr/openwin/lib/locale/%L/%T/%N%S:/usr/openwin/lib/%T/
%N%S
XMICONSEARCHPATH=/export/home/winsor/.dt/icons/%B%M.pm:/export/home/
winsor/
.dt/icons/%B%M.bm:/export/home/winsor/.dt/icons/%B:/usr/dt/appconfig/
icons/
%L/%B%M.pm:/usr/dt/appconfig/icons/%L/%B%M.bm:/usr/dt/appconfig/icons/
%L/%B:/usr/dt/appconfig/icons/C/%B%M.pm:/usr/dt/appconfig/icons/C/
%B%M.bm:/usr/dt/appconfig/icons/C/
%B
TERM=dtterm
dtstart_sessionlogfile=/dev/null
TZ=US/Pacific
DTHELPSEARCHPATH=/export/home/winsor/.dt/help/winsor-castle-0/
%H:/export/home/winsor/.dt/help/winsor-castle-0/%H.sdl:
/export/home/winsor/.dt/help/winsor-castle-0/%H.hv:/export/
home/winsor/.dt/help/%H:/export/home/winsor/.dt/help/%H.sdl:
/export/home/winsor/.dt/help/%H.hv:/usr/dt/appconfig/help/
%L/%H:/usr/dt/appconfig/help/%L/%H.sdl:/usr/dt/appconfig/help/
%L/%H.hv:/usr/dt/appconfig/help/C/%H:/usr/dt/appconfig/help/C/
%H.sdl:/usr/dt/appconfig/help/C/%H.hv
XMBINDDIR=/usr/dt/lib/bindings
WINDOWID=79691820
TERMINAL_EMULATOR=dtterm
PWD=/export/home/winsor
castle%

Using the PATH Variable

The PATH environment variable is very important. When the user executes a command using the full path name, the shell finds the command using that path name. However, when the user specifies only a command name, the shell searches the directories for the command in the order specified by the PATH variable. If the command is found in one of the directories, the shell executes it.

A default su PATH (/sbin:/usr/sbin:/usr/bin:/etc) is set by the system, but most users modify it to add additional command directories. Many user problems related to setting up the environment and accessing the right version of a command or a tool can be traced to incorrectly defined paths.


CAUTION! Including. in the path to search the current directory is a potential security problem. If security is an issue at your site, do not include . as part of a user's path. Never use . as part of the root path.

Setting the Path for Bourne and Korn Shells

The path for the Bourne and Korn shells is specified in the user's $HOME/ .profile file in this way:

PATH=/usr/bin:/$HOME/bin:.

Setting the Path for the C Shell

The path for the C shell is specified in the user's $HOME/.cshrc file (with the set path environment variable) in this way:

set path = (/usr/bin $home/bin.)

See the appropriate manual pages for an in-depth description of these commands and Chapter 10, "Recognizing File Access Problems," for more information about troubleshooting problems with paths.

Using Admintool

Admintool is a graphical user interface that you can use to administer local systems. You can use Admintool to administer:

  User accounts
  Groups
  Hosts
  Printers
  Serial ports
  Software packages

The next section describes how to start Admintool.

Starting Admintool

When using Admintool, you must be a member of the sysadmin UNIX group (GID 14) to run Admintool using your own UID, not as root. Anyone with root permissions on a local system can use Admintool to modify, create, or delete information in the local /etc files for that system. Use the following steps to start Admintool:

1.  Start Admintool from a command line by typing admintool& and pressing Return. The Admintool window is displayed.
2.  Choose the Admintool view that you want to use from the Browse menu, shown in Figure 1-1.


Figure 1-1  The Browse menu.


Previous Table of Contents Next