Printing items before PS1


While perusing the bash documentation, I came across the PROMPT_COMMAND variable. If PROMPT_COMMAND is set, bash will execute the command assigned to the variable prior to displaying PS1:

$ export PROMPT_COMMAND="echo \"straight pimpin\""
straight pimpin $ ``

As you can see from this example, this is super useful. ;)

This article was posted by Matty on 2006-03-23 23:59:00 -0400 -0400