experimente remover as aspas da sua expressão regular.
On Fri, Jan 09, 2009 at 03:16:12PM -0300, M. Rodrigo Monteiro wrote: > 2009/1/9 Eri Ramos Bastos <[email protected]>: > > Seu script deve apontar para /bin/sh ao invés de /bin/bash. > > > > [[]] é específico do Bash e o /bin/sh do Ubuntu é um alias para /bin/dash > > > > Devo apontar para o /bin/sh ou para /bin/bash? > > Testei com os 2: > > # /bin/bash > > # [[ "teste" =~ "^[a-z]+[a-z0-9\._]*$" ]] || echo nao > nao > > # exit > exit > > # /bin/sh > > # [[ "teste" =~ "^[a-z]+[a-z0-9\._]*$" ]] || echo nao > /bin/sh: [[: not found > nao > > # exit > # > > # ls -lha /bin/{sh,bash,dash} > -rwxr-xr-x 1 root root 709K 2008-05-12 15:48 /bin/bash > -rwxr-xr-x 1 root root 86K 2008-06-20 13:07 /bin/dash > lrwxrwxrwx 1 root root 4 2009-01-07 09:14 /bin/sh -> dash > > > Nenhum dos 2 funcionou como esperado. > > Abraços, > Rodrigo. > > -- > M. Rodrigo Monteiro > [email protected] > "Free as in Freedom, not free as in free beer" > "As we are liberated from our own fear, our presence automatically > liberates others" > Linux User # 403730 > > ------------------------------------
