1 |
jan.pradac@××××××.cz writes: |
2 |
|
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 |
Wonko |
21 |
-- |
22 |
gentoo-user@g.o mailing list |