Query: env::ps1
OS: debian
Section: 3pm
Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar
Env::PS1(3pm) User Contributed Perl Documentation Env::PS1(3pm)NAMEEnv::PS1 - prompt string formatterSYNOPSIS# use the import function use Env::PS1 qw/$PS1/; $ENV{PS1} = 'u@h $ '; print $PS1; $readline = <STDIN>; # or tie it yourself tie $prompt, 'Env::PS1', 'PS1'; # you can also tie a scalar ref $format = 'u@h$ '; tie $prompt, 'Env::PS1', $format;DESCRIPTIONThis package supplies variables that are "tied" to environment variables like 'PS1' and 'PS2', if read it takes the contents of the variable as a format string like the ones bash(1) uses to format the prompt. It is intended to be used in combination with the various ReadLine packages.EXPORTYou can request for arbitrary variables to be exported, they will be tied to the environment variables of the same name.TIEWhen you "tie" a variable you can supply one argument which can either be the name of an environement variable or a SCALAR reference. This argument defaults to 'PS1'.METHODS"sprintf($format)" Returns the formatted string. Using this method all the time is a lot less efficient then using the tied variable, because the tied variable caches parts of the format that remain the same anyway.FORMATThe format is copied mostly from bash(1) because that's what it is supposed to be compatible with. We made some private extensions which obviously are not portable. Note that this is not the prompt format as specified by the posix specification, that would only know "!" for the history number and "!!" for a literal "!". Apart from the escape sequences you can also use environment variables in the format string; use $VAR or "${VAR}". The following escape sequences are recognized: a The bell character, identical to "