Article View: comp.os.linux.setup
Article #797Re: Weird custom bash location setup.
From: unruh
Date: Thu, 01 Dec 2011 23:12
Date: Thu, 01 Dec 2011 23:12
17 lines
1927 bytes
1927 bytes
On 2011-12-01, Ant <ANTant@zimage.com> wrote: > In comp.os.linux.setup ceving <ceving@gmail.com> wrote: >> On Nov 29, 3:23?pm, Ant <a...@zimage.comANT> wrote: >> > >> > PS1="\u@\h \[\e[33m\]\W\[\e[0m\] \[\`if [[ \$? = "0" ]]; then echo >> > '\e[32m=)\e[0m'; else echo '\e[31m=(\e[0m' ; fi\`\] \$ " >> > alias grep='grep --color' >> > > >> BTW: Why is it necessary to quote numbers: "0"? > > I don't know. I got this bash customization from /. many years ago. :) "=" is a string comparison-- is string A the same as string B. "0" is s string containing the single character 0. 0 on its own is either a number ( which is not a string) or a character (which is again not a string)
Technical Details
Message-ID:
<9RTBq.1611$cG.259@newsfe14.iad>Path:
arc1-ca.pugleaf.net!y3ni20955bkw.0!nntp.google.com!news2.google.com!npeer02.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!post01.iad.highwinds-media.com!newsfe14.iad.POSTED!00000000!not-for-mailReferences:
<xIKdnYIb65hJd0nTnZ2dnUVZ_r2dnZ2d@earthlink.com> <3ab8cb84-7df6-4728-a236-47d504cb7e21@c18g2000yqj.googlegroups.com> <opedneKWkbgLmkXTnZ2dnUVZ_sednZ2d@earthlink.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 1054c0,d54bef2f321ceea4
X-Google-NewGroupId: yes
X-Google-Attributes: gid4d82dd0a1,domainid0,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
Received: by 10.204.0.73 with SMTP id 9mr1644478bka.4.1322781126315;
Thu, 01 Dec 2011 15:12:06 -0800 (PST)
Path: arc1-ca.pugleaf.net!y3ni20955bkw.0!nntp.google.com!news2.google.com!npeer02.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!post01.iad.highwinds-media.com!newsfe14.iad.POSTED!00000000!not-for-mail
Newsgroups: comp.os.linux.setup,gnu.bash
From: unruh <unruh@invalid.ca>
Subject: Re: Weird custom bash location setup.
References: <xIKdnYIb65hJd0nTnZ2dnUVZ_r2dnZ2d@earthlink.com>
<3ab8cb84-7df6-4728-a236-47d504cb7e21@c18g2000yqj.googlegroups.com>
<opedneKWkbgLmkXTnZ2dnUVZ_sednZ2d@earthlink.com>
User-Agent: slrn/0.9.9p1 (Linux)
Mime-Version: 1.0
Lines: 18
Message-ID: <9RTBq.1611$cG.259@newsfe14.iad>
NNTP-Posting-Host: 24.82.146.42
X-Complaints-To: internet.abuse@sjrb.ca
X-Trace: newsfe14.iad 1322781125 24.82.146.42 (Thu, 01 Dec 2011 23:12:05 UTC)
NNTP-Posting-Date: Thu, 01 Dec 2011 23:12:05 UTC
Date: Thu, 01 Dec 2011 23:12:05 GMT
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit