Using Functions in a BASH Prompt

Posted by jayrfink on Jun 10, 2007 11:25 PM EDT
systhread.net; By Jason (Jay) R. Fink
Mail this story
Print this story

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

  Nav
» Read more about: Story Type: Tutorial; Groups: Community, Debian, Fedora, Fedora Legacy, Gentoo, Linux, LXer, Slackware, SUSE, Ubuntu

« Return to the newswire homepage

Subject Topic Starter Replies Views Last Post
bash is fun! tuxchick 1 2,574 Jun 11, 2007 1:15 PM

You cannot post until you login.