Using Functions in a BASH Prompt

Posted by jayrfink on Jun 10, 2007 9:25 PM
By systhread.net
Mail this story
Web version

One of theneat things a user can do on Unix is play around with the Bourne Again Shell (bash). An even more interesting thing is how the environment can be tweaked to a particular user's preference. In this text a look at how the Bash prompt can be manipulated by inserting commands and even shell code functions directly into the prompt itself.

A Sample Function inline with Bashprompt In a recent text configuring colors for the Bash prompt was discussed. In this text a method of messing with the prompt is expanded upon by actually inserting a shell code function inline with the bash prompt. A Basic Bash Prompt 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. See the rest of the article for more info.

Full Story

Printed at http://lxer.com/module/newswire/view/88207/index.html