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.

Advertisements

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 reflecting on the past three years and reading the article on divided self aptly showing up at the top of my tweeter feed. 5 months ago
  • is having a nice feeling of connecting dots all over the place. they are now illuminating the same point. 6 months ago
  • Style Transfer is fun! TensorFlow rocks! #WTM17 https://t.co/zYP0IFIDfp 8 months ago
  • couldn't get over the jetlag, sleeping during the day from seven to four, for days. 10 months ago
  • is emptying trash and happily discovering the available disk space now ranks at 100G+. 11 months ago

Flickr Photos

%d bloggers like this: