OFF-TOPIC: Bash a regexp matching

Borek Lupomesky borek na lupomesky.cz
Čtvrtek Srpen 4 16:03:13 CEST 2005


>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?

   Hm, zajimave. Tohle funguje v bashi 3.0, ve starsim bashi nikoliv (proto jsem to nenasel v dokumentaci). Ve 2.x by melo fungovat, co jsem napsal, ale zda se mi, ze to proste neni pravda. (Nefunguje ani trivialni matchovani jako [[ "aaa" == a ]] atp.

   Borek


Další informace o konferenci Linux