How to set the prompt?

Brendan Simon bsimon@ctam.com.au
Thu Sep 30 23:42:00 GMT 1999


Leonardo Pedrosa wrote:

> Hello, I'm starting with the cygwin recently and cause my lack of
> experience I have this basic/fool question.
> When a I run Cygnus form Windows98 the prompt stay fixed at BASH.EXE
> 2.02$
> How can I set it like the "prompt $p$g" command of MS-DOS ?
>
> Thank you.
> Leonard
>
> --
> Want to unsubscribe from this list?
> Send a message to cygwin-unsubscribe@sourceware.cygnus.com

I have the following in my .bashrc file.

export PS1="[\h:\w]$ "

This sets the first prompt to the computers hostname followed by the
working directory.  All this is surrounded by square brackets and a
dollar symbol.  This is similar to the RedHat linux prompt.  The "\h"
means host and the "\w" means working directory.  You need to get some
bash documentation.  "man bash" should do it if you have a linux machine
or the documenation stuff installed for your cygwin environment.

If your HOME variable is not set you will probably need to type "source
.bashrc".
Just try export PS1="[\w]$ " at the command prompt to test it.

Brendan Simon.



--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com



More information about the Cygwin mailing list