English

How To: Use UNIX environmental variables ($VARIABLES) with ARC

Procedure

How to use system variables (those prefixed with a $) in ARC/INFO.

Answer:

ARC/INFO versions prior to 7.1.1
--------------------------------

If the variable contains a pathname, it can be used without any changes. ARC
will translate the $VARIABLE into its pathname and then use the pathname in
whatever command is being issued. For example:

Arc: CLEAN $DATAPATH/newcov $DATAPATH/cleancov

If the variable contains something other than a pathname, it can still be used
with ARC by utilizing the [ENTRYNAME] and [PATHNAME] functions. For
example:

&SETVAR term = [ENTRYNAME [PATHNAME $term]]

ARC/INFO version 7.1.1 and higher
---------------------------------

Environment variables at version 7.1.1 are referenced the same way as other AML
variables, through bounding percent (%) signs. Variables used in the application must not have the same name as environment variables. AML first checks the AML environment for the variable and then
checks the system environment. The $ does not need to be included. For
example:

Arc: &type %ARCHOME%
/disk1/dir1/arcexe71

Notes:

ARC/INFO assumes that all system environmental variables are named in upper case letters. ARC will automatically translate it into upper case. In the second example above, the '$TERM' variable was named '$term'. ARC translated the '$term' to upper case and extracted the information from the
system's '$TERM' variable. A system variable named with lower case letters
cannot be used by ARC/INFO.

ARC/INFO is a sub-process. Due to limitations of UNIX, it is impossible for
ARC to alter the setting of a $VARIABLE of a parent process. System variables cannot be set from within ARC. Quit ARC, set the variable, then re-enter ARC.