OFF-TOPIC: Bash a regexp matching

Ladislav Vaiz spam na new.nagano.cz
Čtvrtek Srpen 4 15:58:01 CEST 2005


Nikdy jsm to nepouzil, jen jsem ze zvedavosti kouknul do manualu a tam 
vidim:

An  additional  binary operator, =~, is available, with the same
precedence as == and !=.  When it is used,  the  string  to  the
right  of the operator is considered an extended regular expres-
sion and matched accordingly (as in regex(3)).

Nechcete misto == pouzit spis =~ jako se to dela napriklad v perlu?

La'd"a


On Thu, 4 Aug 2005, Borek Lupomesky wrote:

>   Podle dokumentace by v bashi melo fungovat matchovani regularnich vyrazu asi takto:
>
>   [[ $X == ^abc.+ ]] && echo "MATCH"
>
>   Ale jak se snazim jak chci, tak mi to nefunguje. Co delam spatne?


Další informace o konferenci Linux