A Sample Function inline with Bashprompt

Filed under
HowTos

The bash prompt has built in commands that use escape charachter syntax. By default a lot of packages ship bash with a default that shows the hostname and relative path. The escape sequences for all users is usually kept in /etc/bashrc or a similar system location. The sequences themselves might look something like this:
PS1="[\u@\h:\w]\$

The above settings would look like:
[username@hostname:current_working_directory]$

Or a real example:
[jrf@vela:~/www/systhread.net/texts]$

As noted in theBash Prompt HOWTO commands can be executed everytime the RETURN sequence is sent to the shell interpreter. For this example the Bash Prmpt HOWTO provides ample demonstration of some commands:

More Here