1 |
On Tue, Jan 28, 2014 at 04:06:19PM +0000, James wrote |
2 |
> Walter Dnes <waltdnes <at> waltdnes.org> writes: |
3 |
> |
4 |
> > In your bash profile (if you use bash), howsabout |
5 |
> > export PS1='[\h][\u][\w]' |
6 |
> |
7 |
> > Actually, I go for a fancy "technicolour prompt" |
8 |
> > export |
9 |
> > |
10 |
> > PS1='[\[\033[01;32m\]\h\[\033[00m\]][\[\033[01;34m\]\u\ |
11 |
> > [\033[00m\]][\[\033[01;36m\]\w\[\033[00m\]]' |
12 |
> > Either way, the host name shows up at the beginning of the prompt. |
13 |
> |
14 |
> I like to see the IP addresses of the systems I've sshd into. I work on a |
15 |
> myriad of embedded and small systems, so IP addresses works best for me. |
16 |
|
17 |
In that case, try something like |
18 |
|
19 |
export PS1='[\[\033[01;32m\]192.168.0.1\033[00m\]][\[\033[01;34m\]\u\[\033[00m\]][\[\033[01;36m\]\w\[\033[00m\]]' |
20 |
|
21 |
If you have to determine it after logging in, you can export an |
22 |
environment variable to PS1, e.g. |
23 |
|
24 |
export PS1="[\$FOO]$ " |
25 |
|
26 |
***NOTE THE LEADING BACKSLASH*** See |
27 |
http://stackoverflow.com/questions/7359652/how-to-insert-an-environment-variable-inside-the-bash-prompt |
28 |
|
29 |
-- |
30 |
Walter Dnes <waltdnes@××××××××.org> |
31 |
I don't run "desktop environments"; I run useful applications |