Special $ Variables

The DO file processor supports various special information variables (or built-in macros) which take the form $x or $xx (where x is alphabetic). The supported variables are listed here; those that are A-Shell extensions are noted at the end of the list.

Variable

Value

$:

Original device (e.g. "DSK0:")

$P

Original ppn (e.g. "7,6")

$$

Real dollar sign

$TM

Time of day in 24 hour HH:MM format (e.g. "13:27")

$TD

Current date in YYMMDD format

$TW

Current day of week as a number (0=Mon, 1=Tue,...)

$NJ

Current job name (e.g. "TSKAAA")

$NT

Current terminal name

$ND

Current terminal driver name

$NS

Current OS (e.g. "AIX")

$SV

Current OS version

$UX

Current radix (e.g. "8" or "16")

$LG

Current language (e.g. "ENGLISH")

$LY

Yes character (e.g. "Y")

$LN

No character (e.g. "N")

$NU

Current login name (e.g. "root")

 

The following are supported only under A-Shell:

Variable

Value

$HF

Current host full path (e.g. "/vm/miame/dsk0/001004")

$HD

Current host disk (e.g. "dsk0")

$HP

Current host ppn (e.g. "001004")

$HM

MIAME env var definition (e.g. "/vm/miame")

 

These special information variables are typically used in IF statements or in output messages.

It is necessary to quote these variables when comparing then in IF statements. For example:

IF "$NU" = "jack"      ; (correct)

IF $NU = jack          ; (incorrect)