Unix Shell - customize the shell

This is Interesting: Free IT Magazines  
Home > Archive > Unix Shell > December 2006 > customize the shell





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author customize the shell
Gary Wessle

2006-12-16, 1:19 pm

Hi
when I open an xterm, I see
bash-3.1$
but I want it to be
~/curent_working_dir/ $
so I did

bash-3.1$ PS1='\w $'
~$

it worked, but when I open a new xterm. it goes back to
bash-3.1$

how can I make the changes permanent?


thanks
Stephan Grein

2006-12-16, 1:19 pm

Gary Wessle wrote:
> Hi
> when I open an xterm, I see
> bash-3.1$
> but I want it to be
> ~/curent_working_dir/ $
> so I did
>
> bash-3.1$ PS1='\w $'
> ~$
>
> it worked, but when I open a new xterm. it goes back to
> bash-3.1$
>
> how can I make the changes permanent?

Put it in your .bashrc export PS1='\w $'
>
>
> thanks


hth
--
Stephan Grein, <stephan at stephan minus rockt dot de>
https://stephan-rockt.de
GnuPG-Key-ID: 0xF8C275D4
FingerPrint: 5B6F 134A 189B A24D 342B 0961 8D4B 0230 F8C2 75D4
Chris F.A. Johnson

2006-12-16, 1:19 pm

On 2006-12-16, Gary Wessle wrote:
> Hi
> when I open an xterm, I see
> bash-3.1$
> but I want it to be
> ~/curent_working_dir/ $
> so I did
>
> bash-3.1$ PS1='\w $'
> ~$
>
> it worked, but when I open a new xterm. it goes back to
> bash-3.1$
>
> how can I make the changes permanent?


Put the command in a file that is sourced when you start a new
shell, e.g. ~/.bashrc.

--
Chris F.A. Johnson, author <http://cfaj.freeshell.org/shell>
Shell Scripting Recipes: A Problem-Solution Approach (2005, Apress)
===== My code in this post, if any, assumes the POSIX locale
===== and is released under the GNU General Public Licence
Gary Wessle

2006-12-16, 7:26 pm

Stephan Grein <stephan@stephan-rockt.de> writes:

> Gary Wessle wrote:
> Put it in your .bashrc export PS1='\w $'



in my xterm, in-order to make the command line different color, what
do I need to do?
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com