Article View: alt.linux
Article #303Re: help with color and $PS1
From: David
Date: Fri, 01 Jun 2001 18:09
Date: Fri, 01 Jun 2001 18:09
34 lines
2724 bytes
2724 bytes
Guillaume wrote:
>
> On Fri, 1 Jun 2001, David. E. Goble wrote:
> > I tried;
> >
> > PS1="\n\[\033[1;35m\]IBM 686/pr120+ Linux RedHat 6.2
> > \[\033[0;36m\]\$(date)\n\[\u@\h \W]\\$ \[\033[0;37m\]"
>
> Did you tried :
>
> PS1="\n\[\033[1;35m\]IBM 686/pr120+ Linux RedHat 6.2
> \[\033[0;36m\]\$(date)\n\[\u@\h \W]\\$ \[\033[0m\]"
>
> G.
I don't mean to interupt but I do it like this.
if [ `id -un` = root ]; then
PS1='\[\033[1;31m\]\h:\w\$\[\033[0m\] '
else
PS1='\[\033[1;33m\]\h:\w\$\[\033[0m\] '
fi
This will make the command prompt for root RED and the command prompt
for all users YELLOW. You can change the color of the prompts by
changing the numbers 31m & 33m in the lines above. Everything after the
prompt is in grey letters.
--
Confucius say: He who play in root, eventually kill tree.
Registered with the Linux Counter. http://counter.li.org
ID # 123538
Completed more W/U's than 99.228% of seti users. +/- 0.01%
Technical Details
Message-ID:
<3B17DBC7.40D80D44@netscape.net>Path:
arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!cyclone.bc.net!newsfeed.direct.ca!look.ca!border1.nntp.aus1.giganews.com!nntp3.aus1.giganews.com!news3.aus1.giganews.com.POSTED!not-for-mailReferences:
<3b152146.1043486@news.adelaide.on.net> <Pine.LNX.4.30.0106010857420.924-100000@modemcable131.167-202-24.mtl.mc.videotron.ca>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-01 11:09:06 PST Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!cyclone.bc.net!newsfeed.direct.ca!look.ca!border1.nntp.aus1.giganews.com!nntp3.aus1.giganews.com!news3.aus1.giganews.com.POSTED!not-for-mail Message-ID: <3B17DBC7.40D80D44@netscape.net> From: David <thunderbolt01@netscape.net> Organization: .................................................................... X-Mailer: Mozilla 4.77 [en] (X11; U; Linux 2.2.18 i686) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: alt.linux,aus.computers.linux,comp.os.linux.development.apps,comp.os.linux.setup Subject: Re: help with color and $PS1 References: <3b152146.1043486@news.adelaide.on.net> <Pine.LNX.4.30.0106010857420.924-100000@modemcable131.167-202-24.mtl.mc.videotron.ca> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Lines: 34 NNTP-Posting-Date: Fri, 01 Jun 2001 13:09:06 CDT X-Trace: sv3-Y0cayPzDUVakXnEqzkbujzD5EQuhOGW4MxUBN7LQHkvzKqyX3TH3BLk80mJEVLS7pvKMO0BpwzmJv51!pPKhk9P+9ciVocZKug+/5Ib/BcASyhMYvMP2q+aOnsVNzB84URM7D9sKWiNMoSPBCAQ= X-Complaints-To: abuse@GigaNews.Com X-DMCA-Notifications: http://www.giganews.com/info/dmca.html X-Abuse-Info: Please be sure to forward a copy of ALL headers X-Abuse-Info: Otherwise we will be unable to process your complaint properly Date: Fri, 01 Jun 2001 18:09:06 GMT