Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Weird custom bash location setup.

8 views
Skip to first unread message

Ant

unread,
Nov 29, 2011, 9:23:15 AM11/29/11
to
Hello.

I am trying to figure out why my old .bashrc's current location doesn't
show correctly when in /home directory with:

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'

When I try it out in /home, I see "hmee":
foo@box ~ =) $ cd ..
foo@box hmee =) $ cd /home
foo@box =) $

Why is that? It worked on my 2004's updated Debian box and remote Linux
boxes (Fedora and Debian). I am using Bash v4.1-3 from 64-bit Debian's
stable installation with the latest updates including its backports.

Thank you in advance. :)
--
"What, like I had to live with all those ants? Do you know what I did to
those ants? HoooHooo! No more ants!" --unknown
/\___/\ Ant @ http://antfarm.ma.cx (Personal Web Site)
/ /\ /\ \ Ant's Quality Foraged Links: http://aqfl.net
| |o o| |
\ _ / If crediting, then use Ant nickname and AQFL URL/link.
( ) If e-mailing, then axe ANT from its address if needed.
Ant is currently not listening to any songs on this computer.

J G Miller

unread,
Nov 29, 2011, 11:01:59 AM11/29/11
to
On Tuesday, November 29th, 2011, at 06:23:15h -0800, Ant asked:

> Why is that?

Because there is a bug in the 64 bit version of bash that they
have not fixed and appear not to have any intention of fixing.

cd /boot and I see "bott" in the prompt string.

Please sumbit a bug report to the Debian bash package maintainer.

ceving

unread,
Dec 1, 2011, 1:25:29 PM12/1/11
to
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"?

Ant

unread,
Dec 1, 2011, 6:02:46 PM12/1/11
to
I don't know. I got this bash customization from /. many years ago. :)
--
Quote of the Week: "Stir up an ant's nest." --unknown
/\___/\ Ant @ http://antfarm.home.dhs.org (Personal Web Site)
/ /\ /\ \ Ant's Quality Foraged Links: http://aqfl.net
| |o o| |
\ _ / Please nuke ANT if replying by e-mail. If crediting,
( ) then please kindly use Ant nickname and AQFL URL/link.

Ant

unread,
Dec 1, 2011, 6:03:19 PM12/1/11
to
> > Why is that?

> Because there is a bug in the 64 bit version of bash that they
> have not fixed and appear not to have any intention of fixing.

> cd /boot and I see "bott" in the prompt string.

> Please sumbit a bug report to the Debian bash package maintainer.

Do you happen to have that existing bug report number?
--
Quote of the Week: "Stir up an ant's nest." --unknown
/\___/\ Ant @ http://antfarm.home.dhs.org (Personal Web Site)
/ /\ /\ \ Ant's Quality Foraged Links: http://aqfl.net
| |o o| |
\ _ / Please nuke ANT if replying by e-mail. If crediting,
( ) then please kindly use Ant nickname and AQFL URL/link.

unruh

unread,
Dec 1, 2011, 6:12:05 PM12/1/11
to
On 2011-12-01, Ant <ANT...@zimage.com> wrote:
> In comp.os.linux.setup ceving <cev...@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)

0 new messages