Article View: alt.linux
Article #302Re: help with color and $PS1
From: David. E. Goble
Date: Tue, 05 Jun 2001 08:21
Date: Tue, 05 Jun 2001 08:21
20 lines
1699 bytes
1699 bytes
Hi All;
>
>PS1="\n\[\033[1;35m\]IBM 686/pr120+ Linux RedHat 6.2
>\[\033[0;36m\]\$(date)\n\[\u@\h \W]\\$ "
>
Had another look at it and got it working. Looks like the trick was to
set the color again after the \n.
Thanks to Gilles; I started with
PS1="\[\e[1;31m\]\h:\w\$\[\e[0;0m\] "
It did not work, so replaced the \e with \033 and it did, then I added
the rest.
# /etc/bashrc
...
PS1="\n\[\033[1;35m\]IBM 686/pr120+ Linux RedHat 6.2
\[\033[0;36m\]\$(date)\n\[\033[0;36m\][\u@\h: \w]\\$ \[\033[0;0m\]"
Technical Details
Message-ID:
<3b1ba5d3.39923@news.adelaide.on.net>Path:
arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!feed2.news.rcn.net!rcn!news2.best.com!news1.best.com!duster.adelaide.on.net!203.48.5.207References:
<3b152146.1043486@news.adelaide.on.net>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10c696,dfcc356ec44eb60d X-Google-Attributes: gid10c696,public X-Google-Thread: 102983,dfcc356ec44eb60d X-Google-Attributes: gid102983,public X-Google-Thread: 100c5f,dfcc356ec44eb60d X-Google-Attributes: gid100c5f,public X-Google-Thread: f9b51,dfcc356ec44eb60d X-Google-Attributes: gidf9b51,public X-Google-ArrivalTime: 2001-06-05 01:13:28 PST From: goble@gtech (David. E. Goble) Newsgroups: alt.linux,aus.computers.linux,comp.os.linux.development.apps,comp.os.linux.setup Subject: Re: help with color and $PS1 Date: Tue, 05 Jun 2001 08:21:26 GMT Sender: goble@kin.on.net (David. E. Goble) Organization: Gtech.Computing Reply-To: goble@gtech Message-ID: <3b1ba5d3.39923@news.adelaide.on.net> References: <3b152146.1043486@news.adelaide.on.net> X-Newsreader: Forte Free Agent 1.21/32.243 NNTP-Posting-Host: 203.48.5.207 X-Trace: 5 Jun 2001 17:43:25 +0950, 203.48.5.207 Lines: 22 Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!feed2.news.rcn.net!rcn!news2.best.com!news1.best.com!duster.adelaide.on.net!203.48.5.207