Re: [shell-script] Bash + regex

2009-06-03 Por tôpico Alain M.
Funcionou só no modo compatibilidade 3.1: $ shopt -s compat31 $ IFS="br0 eth0 lo tap0 tap1 tap2 tap3 vmnet8"; set -x; if [[ $IFS =~ "\ O script abaixo funciona. A grande diferença foi não colocar as aspas > de novo na hora de comparar a regex. > > #!/bin/bash > > BATATA="((br|eth|tap)0|lo|tap[1

Re: [shell-script] Bash + regex

2009-06-03 Por tôpico Eri Ramos Bastos
O script abaixo funciona. A grande diferença foi não colocar as aspas de novo na hora de comparar a regex. #!/bin/bash BATATA="((br|eth|tap)0|lo|tap[1-3]|vmnet8)" if [[ "\: > estou com problema para fazer um if em bash usando regex. > > comando: > # IFS="br0 eth0 lo tap0 tap1 tap2 tap3 vmnet8"; s

[shell-script] Bash + regex

2009-06-02 Por tôpico Alain M.
estou com problema para fazer um if em bash usando regex. comando: # IFS="br0 eth0 lo tap0 tap1 tap2 tap3 vmnet8"; set -x; if [[ "$IFS" =~ "\