TCLUG Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [TCLUG:1769] environment variables



In specific:

    % export PATH=$PATH:/new/dir              (ksh and bash)
    % unset DISPLAY                           (clears $DISPLAY)

    % set PATH=$PATH:/new/dir; export PATH    (sh)
    % unset DISPLAY                           (clears $DISPLAY)

    > setenv PATH $PATH:/new/dir              (csh and tcsh)
    > unsetenv DISPLAY                        (clears $DISPLAY)

    will save on retyping all the old directories in the path.  (Those of   
you
    using ash, wish, scsh, jsh, zsh, and other oddities will have to   
figure
    this out for yourself!)

(Personal pet peeve - companies that don't install ksh and csh on their   
Unix
machines in addition to sh.  Please join the 90's before time runs out!)

In general, here's my two cents to contribute to the primer:

$LOGNAME    - current user's login name
$HOME       - current user's home directory
$PWD        - the directory you are in (Present Working Directory)
$SHELL      - the name of the shell you are using (bash, ksh, ...)
$CDPATH     - search path for cd command, $PWD is checked first, then   
$CDPATH
$PS1        - the command prompt (may vary by SHELL)
$LOCALE     - the default language/display format on many Unix platforms
$TZ         - the time zone used by your host

$DISPLAY    - used by X Windows applications to decide which X server to   
connect to
              (fun for popping up windows on a friend's machine!)

$TERM       - tells programs you run which termcap/terminfo entry to use
$COLUMNS    - the number of columns in your terminal window
$LINES      - the number of lines in your terminal window

$VISUAL     - default editor
$EXINIT     - commands for vi to execute after startup
              (i.e. instead of manually executing ":set ts=4", try
              "export EXINIT='ts=4'")

$CLASSPATH  - search path for Java .class files
$JAVA_HOME  - search path for Java exe's (JVM)
$CGIBIN     - search path for CGI scripts

$CC         - the default C compiler (/usr/local/bin/gcc or similar)
$LD         - the default linker

For Sybase products:

$DSQUERY    - default entry in $SYBASE/interfaces for the client to   
connect to
$DSLISTEN   - default entry in $SYBASE/interfaces for the server to   
listen on
$SYBASE     - install directory for the Sybase product, can be different   
for
              different products (i.e. SQL Server may be installed in a   
different
              directory than Open Client)
$SHLIB_PATH - location of shared library files (for Sybase on HP/UX)

And, this evenings special bonus ... 2 stupid terminal tricks!

When using telnet to a different machine and you hit the backspace key   
and only get ^H
on the screen, execute the following to clear up the problem.

    % stty erase ^H

In ksh, if you want to use the vi keystrokes to edit your command   
history, type

    % set -o vi

after that, you can use esc, x, i, and all the other vi keystrokes.
Use esc followed by k and j to scroll through your command history.