SourceFiles.org - Use the Source, Luke
Home | Register | News | Forums | Guide | MyLinks | Bookmark

Related Sites

Latest News
  General News
  Reviews
  Press Releases
  Software
  Hardware
  Security
  Tutorials
  Off Topic


Back to files

PProm - portable shell prompts

Synopsis

pprom [options] command
pprom --help

See the manpage for descriptions of the various options and commands.

Description

PProm lets you write your shell prompts in a simple shell-independent syntax, `compiling' prompts into the particular form required by each shell.

For example, say you want to set a simple prompt such as this (there's a space at the end):

user@host ~/path/to/the/current/directory >

To get this prompt in bash, you would have to use this syntax:

'\u@\h \w > '

In csh, tcsh, or zsh, it would be this:

'%n@%m %~ > '

The pprom syntax for this prompt would be the same for either shell:

'@user @at @host @space @cwd @space @gt @space'

You can also use shell-dependent features, if you wish. For example, the symbol `@sigil' represents the character `#' (if root) or `@' (if non-root in csh) or `$' (if non-root in bash), and the symbol @shell represents the name of the shell (e.g., `bash' or `zsh').

PProm comes with shell-specific configuration files for bash and csh.

Setting prompts in your login files

bash and sh:

PS1=`pprom '@user @at @host @space @cwd @space'`

csh and tcsh:

set prompt = `pprom '@user @at @host @space @cwd @space'`

Examples you can use in your ~/.bashrc and ~/.cshrc files may be found in the files `bashrc' and `cshrc' in the `examples' directory.


Other Sites

Discussion Groups
  Beginners
  Distributions
  Networking / Security
  Software
  PDAs

About | FAQ | Privacy | Awards | Contact
Comments to the webmaster are welcome.
Copyright 2006 Sourcefiles.org All rights reserved.