How-to: macOS Environment variables

       AFSUSER (+)
        Equivalent to the afsuser shell variable.

       COLUMNS The number of columns in the terminal.

       DISPLAY Used by X Window System.  If set, the shell does not set autologout (q.v.)

       EDITOR  The pathname to a default editor.  See also the VISUAL environ-
        ment variable and the run-fg-editor editor command.

       GROUP (+)
        Equivalent to the group shell variable.

       HOME    Equivalent to the home shell variable.

       HOST (+)
        Initialized  to the  name of the machine on which the shell is
        running, as determined by the gethostname(2) system call.

       HOSTTYPE (+)
        Initialized to the type of machine on which the shell  is  run-
        ning, as determined at compile time.  This variable is obsolete
        and will be removed in a future version.

       HPATH (+)
        A colon-separated list of directories  in  which  the  run-help

        editor command looks for command documentation.

       LANG    Gives the preferred character environment.

        If set, only ctype character handling is changed.

       LINES   The number of lines in the terminal.

        The format of this variable is reminiscent  of  the  termcap(5)
        file  format; a colon-separated list of expressions of the form
        "xx=string", where "xx" is a two-character variable name.   The
        variables with their associated defaults are:

     no 0      Normal (non-filename) text
     fi 0      Regular file
     di 01;34  Directory
     ln 01;36  Symbolic link
     pi 33     Named pipe (FIFO)
     so 01;35  Socket
     do 01;35  Door
     bd 01;33  Block device
     cd 01;32  Character device
     ex 01;32  Executable file
     mi (none) Missing file (defaults to fi)
     or (none) Orphaned symbolic link (defaults to ln)
     lc ^[[    Left code
     rc m      Right code
     ec (none) End code (replaces lc+no+rc)

        You  need to include only the variables you want to change from
        the default.

        File names can also be colorized based on  filename  extension.
        This  is  specified  in the LS_COLORS variable using the syntax
        "*ext=string".  For example, using ISO 6429 codes, to color all
        C-language  source files blue you would specify "*.c=34".  This
        would color all files ending in .c in blue (34) color.

        Control characters can be  written  either  in  C-style-escaped
        notation,  or  in  stty-like  ^-notation.  The C-style notation
        adds ^[ for Escape, _ for a normal space character, and ?  for
        Delete.  In  addition, the ^[ escape character can be used to
        override the default interpretation of ^[, ^, : and =.

        Each file will be written as <lc> <color-code> <rc>  <filename>

        <ec>.   If  the <ec> code is undefined, the sequence <lc> <no>
        <rc> will be used instead.  This is generally  more  convenient
        to  use,  but  less general.  The left, right and end codes are
        provided so you don't have to type common parts over  and  over
        again  and  to  support weird terminals; you will generally not
        need to change them at all unless your terminal does  not  use
        ISO 6429 color sequences but a different system.

        If your terminal does use ISO 6429 color codes, you can compose
        the type codes (i.e., all except the lc, rc, and ec codes) from
        numerical  commands  separated  by semicolons.  The most common
        commands are:

         0   to restore default color
         1   for brighter colors
         4   for underlined text
         5   for flashing text
         30  for black foreground
         31  for red foreground
         32  for green foreground
         33  for yellow (or brown) foreground
         34  for blue foreground
         35  for purple foreground
         36  for cyan foreground
         37  for white (or gray) foreground
         40  for black background
         41  for red background
         42  for green background
         43  for yellow (or brown) background
         44  for blue background
         45  for purple background
         46  for cyan background
         47  for white (or gray) background

        Not all commands will work on all systems or display devices.

        A few terminal programs do not recognize the default  end  code
        properly.   If all text gets colorized after you do a directory
        listing, try changing the no and fi codes from 0 to the numeri-
        cal codes for your standard fore- and background colors.

       MACHTYPE (+)
        The  machine  type  (microprocessor class or machine model), as
        determined at compile time.

       NOREBIND (+)
        If set, printable characters are not  rebound  to  self-insert-

       OSTYPE (+)
        The operating system, as determined at compile time.

       PATH    A colon-separated list of directories in which to look for exe-
        cutables.  Equivalent to the path shell variable, but in a dif-
        ferent format.
          In tcsh edit the ~/.tcshrc file and add a line like
              set path = ( $path /Developer/Tools )
             tcsh will then update 'PATH' based on 'path'
          In bash edit the ~/.profile file and add a line like
              export PATH="$PATH:/Developer/Tools"

       PWD (+) Equivalent  to  the cwd shell variable, but not synchronized to
        it; updated only after an actual directory change.

       REMOTEHOST (+)
        The host from which the user has logged in remotely, if this is
        the  case  and  the shell is able to determine it.  Set only if
        the shell was so compiled; see the version shell variable.

       SHLVL (+)
        Equivalent to the shlvl shell variable.

       SYSTYPE (+)
        The current system type.  (Domain/OS only)

       TERM    Equivalent to the term shell variable.

       TERMCAP The terminal capability string.

       USER    Equivalent to the user shell variable.

       VENDOR  The vendor, as determined at compile time.

       VISUAL  The pathname to a default full-screen  editor. See  also  the
        EDITOR  environment  variable and the run-fg-editor editor com-

Related macOS comands:

bash shell variables
env - List or Set environment variables.

Copyright © 1999-2020
Some rights reserved