Changing prompt and echo statement colours?
Gene Heskett
gene.heskett at verizon.net
Wed Jun 23 20:10:43 UTC 2004
On Tuesday 15 June 2004 23:07, T. 'Nifty New Hat' Mitchell wrote:
New hat eh? I found me one at a truck stop in Iowa while on a trip
west this past week, says "I'm retired" in big bold letters on line 1
and "(this is a dressed up as I get)" on line 2. Obviously I had to
have it. :-)
>On Mon, Jun 14, 2004 at 03:07:00PM +0200, Alexander Dalloz wrote:
>> Am Mo, den 14.06.2004 schrieb Chadley Wilson um 14:13:
>> > I would like to have a message displayed when users open the
>> > terminal. This I can do! But.
>
>....
>
>> http://www.faqs.org/docs/Linux-HOWTO/Bash-Prompt-HOWTO.html
>
>Did this URL move/break? Anyhow since it looks broken at this
> moment.
>
>Two quick reminders.
>
>In the .bash-* files remember to verify that this is an interactive
>tty (pseudo terminal session). Many scripts, cronjobs, remote user,
>ssh user stuff will BREAK if bash is noisy when it should be quiet.
Stuff like X! I spent a week trying to figure that one out as it was
several days after I changed the prompt before I had to restart X,
and all I could get was the black screen with a working X shaped
mouse pointer. No errors, none, nada, were being logged.
>Also test the $TERM environment variable and verify
>that this is a terminal that supports the magic you want.
>Have a default that makes sense... there are more than 1300
>terminals described in the termcap data base you will not get
>them all so focus on the one or two you care about.
>
>Since this is an international list I should add that language
>and character sets can be important. If things look broken
>and you get stuck language and character variables too.
>
>Take /etc/bashrc as a starting place. Note that two things are
>checked... Interactive and $TERM=xterm. If users are at the
>end of a wyse50, vt100 or some other terminal/ emulation recheck
>this stuff.
>
> ================ snip =======================
> # are we an interactive shell?
> if [ "$PS1" ]; then
> case $TERM in
> xterm*)
> if [ -e /etc/sysconfig/bash-prompt-xterm ]; then
> PROMPT_COMMAND=/etc/sysconfig/bash-prompt-xterm
> else
> PROMPT_COMMAND='echo -ne
> "\033]0;${USER}@${HOSTNAME%%.*}:${PWD/#$HOME/~}\007"' fi
> ================ snip =======================
>
>Other shells (ksh, csh, tcsh) test for an interactive session
>differently. Note that csh and tcsh may want $term not $TERM. The
>escape sequences are specific to the terminal program, RTFM.
>
>Note the subtle change from $ to # as a user switches from
>a normal user to root (UID=0). Keep this small change intact.
>
>
>--
> T o m M i t c h e l l
> /dev/null the ultimate in secure storage.
--
Cheers, Gene
There are 4 boxes to be used in defense of liberty. Soap, ballot,
jury, and ammo.
Please use in that order, starting now. -Ed Howdershelt, Author
Additions to this message made by Gene Heskett are Copyright 2004,
Maurice E. Heskett,
all rights
reserved.
More information about the fedora-list
mailing list