B.2. Prompt String Customizations

 < Day Day Up > 

Table B-3 shows a summary of the prompt customizations that are available. The customizations \[ and \] are not available in bash versions prior to 1.14. \a, \e, \H, \T, \@, \v, and \V are not available in versions prior to 2.0. \A, \D, \j, \l, and \r are only available in later versions of bash 2.0 and in bash 3.0.

Table B-3. Prompt string customizations




The ASCII bell character (007)


The current time in 24-hour HH:MM format


The date in "Weekday Month Day" format

\D {format}

The format is passed to strftime(3) and the result is inserted into the prompt string; an empty format results in a locale-specific time representation; the braces are required


The ASCII escape character (033)


The hostname


The hostname up to the first "."


The number of jobs currently managed by the shell


The basename of the shell's terminal device name


A carriage return and line feed


A carriage return


The name of the shell


The current time in 12-hour HH:MM:SS format


The current time in HH:MM:SS format


The current time in 12-hour a.m./p.m. format


The username of the current user


The version of bash (e.g., 2.00)


The release of bash; the version and patchlevel (e.g., 3.00.0)


The current working directory


The basename of the current working directory


The command number of the current command


The history number of the current command


If the effective UID is 0, print a #, otherwise print a $


Character code in octal


Print a backslash


Begin a sequence of non-printing characters, such as terminal control sequences


End a sequence of non-printing characters

     < Day Day Up > 

    Learning the bash Shell
    Learning the bash Shell: Unix Shell Programming (In a Nutshell (OReilly))
    ISBN: 0596009658
    EAN: 2147483647
    Year: 2005
    Pages: 139

    Similar book on Amazon

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net