Gentoo Archives: gentoo-user

From: Willie Wong <wwong@×××××××××.EDU>
To: gentoo-user@l.g.o
Subject: [gentoo-user] Bash 3.2/3.1 compatibility?
Date: Fri, 09 Nov 2007 19:47:03
Message-Id: 20071109194141.GA17772@princeton.edu
1 Hi list,
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 I have been putting off upgrading to bash 3.2 because of this (I do
15 fully intend to go back and fix all the problems with the script,
16 just that I have a lot less free time now than 2 years ago when I
17 wrote those scripts), but now the new version of portage demands
18 bash 3.2 or better.
19
20 The question:
21
22 Is there a switch that I can use to make bash run in some sort of
23 compatibility mode for the string comparison? I.e, can I somehow
24 force bash (in the script) to behave like before?
25
26 Thanks,
27
28 Willie
29 --
30 "Trillian did a little research in the ship's copy of
31 THHGTTG. It had some advice to offer on drunkenness.
32 `Go to it,' it said, `and good luck.'
33 It was cross-referenced to the entry concerning the size of
34 the Universe and ways of coping with that."
35
36 - One of the more preferable pieces of advice contained in
37 the Guide.
38 Sortir en Pantoufles: up 336 days, 18:03
39 --
40 gentoo-user@g.o mailing list

Replies

Subject Author
Re: [gentoo-user] Bash 3.2/3.1 compatibility? Alex Schuster <wonko@×××××××××.org>
Re: [gentoo-user] Bash 3.2/3.1 compatibility? Etaoin Shrdlu <shrdlu@×××××××××××××.org>