Gentoo Archives: gentoo-user

From: Willie Wong <wwong@×××××××××.EDU>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Bash 3.2/3.1 compatibility?
Date: Sat, 10 Nov 2007 15:25:03
Message-Id: 20071110151547.GC27102@princeton.edu
In Reply to: Re: [gentoo-user] Bash 3.2/3.1 compatibility? by Alex Schuster
1 On Sat, Nov 10, 2007 at 01:46:33PM +0100, Penguin Lover Alex Schuster squawked:
2 > jan.pradac@××××××.cz writes:
3 > > I have the same problem and I was trying to solve it few weeks ago,
4 > > after almost two weeks of searching and compiling I substituted =~ with
5 > > expr:
6 > >
7 > > - orig use with ~= :
8 > > # if [[ "test" =~ ".*" ]]; then echo "ok"; fi
9 > >
10 > > - alternative use with expr :
11 > > # export TEST_VAR="test"
12 > > # if [[ ${#TEST_VAR} == `expr "${TEST_VAR}" : ".*"` ]]; then echo "ok";
13 > > fi
14 >
15 > Or like this:
16 >
17 > match=".*"
18 > if [[ "test" =~ $match ]]; then echo "ok"; fi
19
20 Thanks for the suggestions. I'll try them out on my test box when I
21 get home.
22
23 W
24 --
25 What is the meaning of Life?
26
27 To search for truth and beauty.
28 To ask questions.
29 To find the answer to this question
30 To rigorously mathematically prove by epislon-delta treatment that this
31 question has no answer. Proof? For all oranges greater than zero, there exists
32 a banana such that for all fruits tastier than the banana, an orange sweeter
33 than a banana implies the orange is yellow. So by the Jedi-Schwartz Inequality,
34 all oranges are not orange. This leads to an obvious contradiction.
35
36 It's too bad life is a departmental requirement, otherwise I'd P/D/F it.
37
38 ~Phil Wei
39 Sortir en Pantoufles: up 337 days, 13:43
40 --
41 gentoo-user@g.o mailing list