Click to See Complete Forum and Search --> : bash prompt questions (cheeky_zombie?)


Ludootje
01-31-2002, 04:38 PM
so i want to have my prompt working like that wonderful pic on http://www.jamsession.co.uk/test/bash_prompt.html
http://www.jamsession.co.uk/test/bash_prompt.png
It's a bash prompt howto by zombie, and i like the way his prompt looks.
so my .bashrc is now:


# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files for examples

# If running interactively, then:
if [ "$PS1" ]; then

# enable color support of ls and also add handy aliases

export LS_OPTIONS='--color=auto'
eval `dircolors`
alias ls='ls $LS_OPTIONS'
alias ll='ls $LS_OPTIONS -l'
alias l='ls $LS_OPTIONS -lA'
#alias dir='ls --color=auto --format=vertical'
#alias vdir='ls --color=auto --format=long'

# set a fancy prompt

PS1='\[\033[1;32m\]{\033[0m\]\u\[\033[1;32m\]@\[\033[0m\]\H\[\033[1;32m\]} (\[\033[0m\]\w\[\033[1;32m\]) (\[\033[0m\]\$\[\033[1;32m\])\[\033[0m\] '
fi


though, i get this:
http://www.ludootje.f2s.com/screenshots/prompt.png

edit: fixed zombie's name in the topic :o

[ 01 February 2002: Message edited by: Ludootje ]

Shadoglare
01-31-2002, 04:43 PM
Hey I like the looks of that terminal program.. which one is it?

Ludootje
01-31-2002, 05:20 PM
zombie's one or mine? mine is gnome-terminal, zombie uses eterms

[ 31 January 2002: Message edited by: Ludootje ]

bigrigdriver
01-31-2002, 07:31 PM
I added this to /etc/config.d/shells/profile to make my bash prompt globally available:
# bash-specific settings
ROOT UID = 0
if [ "$UID" -eq "$ROOT_UID" ]
PS1="\[\033[31;1m\]\u] \\$\w\n ] \[\033[0m\]"
else
PS1="\[\033[34;1m\]\u] \\$\w\n ]
[\033[0m\]"
fi

(the PS1 lines should be all one line in bashrc).
This setup gives me a prompt which shows whether I'm logged in as root or user.
Root appears in bright red; user in blue.
Prompt shows full path to working directory, not just the working directory.
Reset colors to black on white.
Issue newline command to place curser at far left under the prompt.
Try it. You might like it.
There's always the bash-HOWTO and the bash reference manual for more info on how to configure a prompt to your preferences.

[ 31 January 2002: Message edited by: bigrigdriver ]

[ 31 January 2002: Message edited by: bigrigdriver ]

mdwatts
01-31-2002, 07:40 PM
Originally posted by bigrigdriver:
<STRONG>I added this to /etc/config.d/shells/profile to make my bash prompt globally available:
# bash-specific settings
ROOT UID = 0
if [ "$UID" -eq "$ROOT_UID" ]
PS1="\[\033[31;1m\]\u] \\$\w\n ] \[\033[0m\]"
else
PS1="\[\033[34;1m\]\u] \\$\w\n ]
[\033[0m\]"
fi

(the PS1 lines should be all one line in bashrc).
This setup gives me a prompt which shows whether I'm logged in as root or user.
Root appears in bright red; user in blue.
Prompt shows full path to working directory, not just the working directory.
Reset colors to black on white.
Issue newline command to place curser at far left under the prompt.
Try it. You might like it.
There's always the bash-HOWTO and the bash reference manual for more info on how to configure a prompt to your preferences.

</STRONG>

An hour or so ago, I was going to post the suggestion to use the global config files to add PS1 prompts and aliases etc., but for the life of me, I couldn't remember where they were.

Thanks for reminding me bigrigdriver.

bdl
01-31-2002, 08:49 PM
Ludootje - was there a problem with the way your prompt came out?? I don't quite understand the meaning of your post.

DMR
01-31-2002, 10:51 PM
Originally posted by WattsMD...
Is this the newest incarnation of mdwatts?

DMR
01-31-2002, 10:55 PM
There's a fair amount of info on prompt customization in the Bash-Prompt HOWTO (http://www.linuxdoc.org/HOWTO/Bash-Prompt-HOWTO/index.html) at LDP.
:)

DMR
01-31-2002, 11:44 PM
[QB] Originally posted by WattsMD...
Is this the newest incarnation of mdwatts? Judging from the Sig, my guess is yes.

z0mbix
02-01-2002, 04:03 AM
Hey ludo,

Is it the font you want, the colour or the font size?

mdwatts
02-01-2002, 05:53 AM
Originally posted by DMR:
<STRONG>Originally posted by WattsMD...
Is this the newest incarnation of mdwatts?</STRONG>


:D Tis me.

Rescued by FoBoT and his extra account.

How you doing David?

&lt;edit&gt;

The only good thing about starting over is I get to party again when I get to be a Grasshopper. ;)

[ 01 February 2002: Message edited by: WattsMD ]

z0mbix
02-01-2002, 06:18 AM
I'm surprised you haven't reached grasshopper stage yet considering the amount of posts you rack up! You must be nearing 10k soon???

:)

Ludootje
02-01-2002, 11:48 AM
Originally posted by bdl:
<STRONG>Ludootje - was there a problem with the way your prompt came out?? I don't quite understand the meaning of your post.</STRONG>
well, i wanted it to look like zombie's one, but as you can see from the screenie, it isn't looking like that AT ALL :(

Ludootje
02-01-2002, 11:48 AM
Originally posted by cheeky_zombie:
<STRONG>Hey ludo,

Is it the font you want, the colour or the font size?</STRONG>
the colour :)

z0mbix
02-01-2002, 12:11 PM
use this then:

PS1='\[\033[1;37m\]{\033[0m\]\u\[\033[1;37m\]@\[\033[0m\]\H\[\033[1;37m\]} (\[\033[0m\]\w\[\033[1;37m\]) (\[\033[0m\]\$\[\033[1;37m\])\[\033[0m\]

I've changed all [1;32m\]'s to [1;37m\]

Was my howto no good? ;)

Ludootje
02-01-2002, 01:22 PM
your howto was great, and since i liked your prompt, i copied it from the page, but it seems that the code of your prompt isn't correct on your page :confused:*?*

Ludootje
02-01-2002, 02:31 PM
thanks a lot zombie, so now i have this wonderful prompt:

http://www.ludootje.f2s.com/screenshots/gterm.png

with the PS1 variable set to:
PS1='\[\033[1;37m\]{\033[0m\]\u\[\033[1;37m\]@\[\033[0m\]\H\[\033[1;37m\]\[\033[1;37m\]@\[\033[0m\]\w\[\033[1;37m\]\[\033[1;37m\]} '

[ 01 February 2002: Message edited by: Ludootje ]

mdwatts
02-01-2002, 02:46 PM
Originally posted by cheeky_zombie:
<STRONG>I'm surprised you haven't reached grasshopper stage yet considering the amount of posts you rack up! You must be nearing 10k soon???

:)</STRONG>

I can't figure it out cheeky. I have around 9,000 posts and I'm still a Junior Grasshopper. When are they going to fix the UBB problems? Seems to only effect me though.

Ludootje
02-01-2002, 03:19 PM
Originally posted by WattsMD:
<STRONG>Seems to only effect me though.</STRONG>
bradmont has lost a lot off accounts too.. one of those blacknights said he was working on upgrading the bbs to a vbulletin board, and when i asked when it would be done he said 'in the next month', but that was in december :rolleyes:

BAH