Gentoo Archives: gentoo-user

From: Alex Schuster <wonko@×××××××××.org>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Bash 3.2/3.1 compatibility?
Date: Sat, 10 Nov 2007 03:19:20
Message-Id: 200711100413.32267.wonko@wonkology.org
In Reply to: [gentoo-user] Bash 3.2/3.1 compatibility? by Willie Wong
1 Willie Wong writes:
2
3 > The situation:
4 > I have some bash scripts written. The scripts contains a lot of
5 > string comparisons. Perhaps my code was buggy before, perhaps it was
6 > not, but the change
7 >
8 > "Quoting the string argument to the [[ command's =~ operator now
9 > forces string matching, as with the other pattern-matching
10 > operators."
11 >
12 > between 3.1->3.2 complete breaks my script.
13
14 Yeah, I had the same problem. Very annoying.
15
16
17 > The question:
18 >
19 > Is there a switch that I can use to make bash run in some sort of
20 > compatibility mode for the string comparison? I.e, can I somehow
21 > force bash (in the script) to behave like before?
22
23 I am pretty sure there is none. The suggested workaround is to put the
24 string to be matched into a variable:
25
26 <http://bashcurescancer.com/bash_faq_version_336_for_bash_version_32#SUB-E14>
27
28 Wonko
29 --
30 gentoo-user@g.o mailing list

Replies

Subject Author
Re: [gentoo-user] Bash 3.2/3.1 compatibility? <jan.pradac@××××××.cz>