Built-in Shell Variables

All three shells have a set of single-character variables that are set initially by the shell, as shown in Table 83. You can use these variables to access words in variables and return other information about the variable. These variables are used differently in the C shell than they are in the Bourne and Korn shells.

Bourne and Korn Shells Built-in Variables

Table 83 describes the built-in variables initialized by the Bourne and Korn shells.

Table 83. Built-in Variables Initialized by the Bourne and Korn Shells
Variable Explanation
$* List the value of all command-line parameters. This variable is useful only in scripts because the login shell has no arguments associated with it.
$# Return the number of command-line arguments ...

Get Solaris™ 8 Advanced System Administrator's Guide, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.