Dependent Origination

How to set shell prompt (BASH)

Posted on: January 6, 2011

PS1=’\u@\h:\W$ ‘

1. don’t have spaces around =

2. don’t forget the space after $

Here is a complete list of the options available.

5 Responses to "How to set shell prompt (BASH)"

Try my prompt: (the escape sequences are for colors, you can tweak them if you don’t have black background)

\[33[0;35m\]\[33[1;35m\]\[33[1;34m\](\[33[1;35m\]\u\[33[0;35m\]@\[33[1;35m\]\h\[33[1;34m\])\[33[1;35m\]\[33[1;34m\](\[33[1;35m\]$(date +%I:%M%P)\[33[0;35m\]:\[33[1;35m\]$(date +%m/%d/%y)\[33[1;34m\])\[33[0;35m\]\[33[0;36m\]\n\[33[0;35m\]\[33[1;35m\]\[33[1;34m\](\[33[0;35m\]\w\[33[1;34m\])\[33[1;35m\]>\[33[0;36m\]

the escape looks a bit wrong…not showing colors at all…
did you copy the entire line?

Oh, the html input seemed to have eaten some characters, let me try this:

(ann@misto)(02:46am:01/08/11)
(~)> echo $PS1
\[33[0;35m\]\[33[1;35m\]\[33[1;34m\](\[33[1;35m\]\u\[33[0;35m\]@\[33[1;35m\]\h\[33[1;34m\])\[33[1;35m\]\[33[1;34m\](\[33[1;35m\]$(date +%I:%M%P)\[33[0;35m\]:\[33[1;35m\]$(date +%m/%d/%y)\[33[1;34m\])\[33[0;35m\]\[33[0;36m\]\n\[33[0;35m\]\[33[1;35m\]\[33[1;34m\](\[33[0;35m\]\w\[33[1;34m\])\[33[1;35m\]>\[33[0;36m\]

blush, still not right, I think it’s wordpress’s input filter which removed some slashes, so much about showing off exotic configuration, sorry about the very long line~~

i will try it out more when i have more time.
it should be discernible where html escape ate up the slashes…

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

January 2011
M T W T F S S
« Dec   Feb »
 12
3456789
10111213141516
17181920212223
24252627282930
31  

Twitter

  • is emptying trash and happily discovering the available disk space now ranks at 100G+. 4 days ago
  • is looking at other people's intentions, not their capabilities, and feeling much happier every day :) 11 months ago
  • is planning on how to spend the next two weeks until the new year, at home. 11 months ago
  • is going to have human company for Thanksgiving; a rare event for the past like twenty years. 1 year ago
  • living by myself again; a strange feeling in a bustling city with thirteen million people 1 year ago

Flickr Photos

IMG_3517

IMG_3515

IMG_3505

IMG_3497

IMG_3261

IMG_3260

IMG_3255

IMG_2736

IMG_2733

IMG_2629

More Photos
%d bloggers like this: