On 02/22/2011 08:24 PM, Peng Yu wrote: > Suppose that I have a variable $x, I want to test if the content of $x > match the pattern 'abc*'. If yes, then do something. (The operator == > doesn't match patterns, if I understand it correctly.) > > Is there such a build-in feature in bash? Or I have to rely on some > external program such as perl to test the pattern matching?
case $x in abc*) ... ;; esac -- Eric Blake ebl...@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature