Go to the first, previous, next, last section, table of contents.


Parameters

As mentioned above, parameters are named values with special meanings. Their values are only changed implicitly as the result of some other command, never explicitly. All parameters are named by single characters. The only place that parameters are accessible is in parameter substitution. The defined parameters are:

`+'
The current system time in seconds, usually the number of seconds since 1 Jan 1970.
`:'
The current host, as returned by the gethostname(2) system call or equivalent. This may contain a domain name part, so if just the host name is of interest, it is wise to use
${::p}
to take the prefix if there is one.
`~'
The login name of the current user, as determined by
getpwuid(geteuid())
`?'
The return status of the last command to exit. If the commanded exitted due to a signal, this value is 1000 more than the number of the signal. "' FIXME what about stopped processes
`%'
The process id of the parent of the shell process, as returned by getppid()
`$'
The process id of the shell process, as returned by getpid()
`.'
The current working directory. See cd under Builtins.
`!'
The process id of the last process to be run in the background.
`#'
The number of elements in the array ARGV. Actually the highest index of an element in ARGV which is not undefined.
`-'
A string containing the characters for all the flags currently in effect, as set on the command line, or deduced at startup (for -s and -i) or as set by set.

Earlier shells considered digits and the characters '*' and '' to be parameters. This shell treats them as special cases of variable substitutions, as mentioned below.


Go to the first, previous, next, last section, table of contents.