
642
|
Chapter 6: The Bash Shell and Korn Shell
This is the Title of the Book, eMatter Edition
Copyright © 2006 O’Reilly & Associates, Inc. All rights reserved.
.sh.subscript
The subscript of the array element being changed.
.sh.value
The value of the variable being assigned or returned. Changing it within the
discipline function changes the value that is actually assigned or returned.
Special Prompt Strings
Both shells process the value of PS1 for special strings. The Korn shell expands a
single ! into the current command number. Use !! to get a literal !. For example:
PS1='cmd !> '
Bash processes the values of PS1, PS2, and PS4 for the following special escape
sequences.
Escape sequence Description
\a An ASCII BEL character (octal 07).
\A The current time in 24-hour HH:MM format.
\d The date in “weekday month day” format.
\D{format} The date as specified by the strftime(3) format format. The braces are required.
\e An ASCII Escape character (octal 033).
\h The hostname, up to the first period.
\H The full hostname.
\j The current number of jobs.
\l The basename of the shell’s terminal device.
\n A newline character.
\r A carriage-return character.
\s The name of the shell (basename of $0).
\t The current time in 24-hour HH:MM:SS format.
\T The current time in 12-hour HH:MM:SS format.
\u The current user’s username.
\v The version of Bash.
\V The release (version plus patch level) of Bash.
\w The current directory, ...