patterns in case statement in bash scripting

Posted by Ramiro Rela on Stack Overflow See other posts from Stack Overflow or by Ramiro Rela
Published on 2010-12-29T13:57:34Z Indexed on 2010/12/29 16:54 UTC
Read the original article Hit count: 162

Filed under:
|
|
|
|

The man says that case statements use "filename expansion pattern matching".
I usually want to have short names for some parameters, so I go:

case $1 in
    req|reqs|requirements) TASK="Functional Requirements";;
    met|meet|meetings) TASK="Meetings with the client";;
esac

logTimeSpentIn "$TASK"

I tried patterns like "req*" or "me{e,}t" which I understand would expand correctly to match those values in the context of filename expansion, but it doesn't work.

Thanks.

© Stack Overflow or respective owner

Related posts about bash

Related posts about scripting