07-18-2006
|
#2 (permalink)
|
| Linux Engineer
Join Date: Apr 2006 Location: Saint Paul, MN, USA / CentOS, Debian, Solaris, SuSE
Posts: 817
| Hi, paolodina.
I have no immediate solution for you without some thought, but the expressions used in the case statement are essentially pathname expressions (such as you use on the command line), not regular expressions: Code: case word in [ [(] pattern [ | pattern ] ... ) list ;; ] ... esac
A case command first expands word, and tries to match it against
each pattern in turn, using the same matching rules as for path-
name expansion (see Pathname Expansion below). When a match is
found, the corresponding list is executed. After the first
match, no subsequent matches are attempted. The exit status is
zero if no pattern matches. Otherwise, it is the exit status of
the last command executed in list -- man bash
You may need to do some processing with sed if you want to involve regular expressions in a case statement.
Perhaps our colleagues have some more creative ideas ... cheers, drl
__________________ Welcome - get the most out of the forum by reading forum basics and guidelines: click here.
90% of questions can be answered by using man pages, Quick Search, Advanced Search, Google search, Wikipedia.
We look forward to helping you with the challenge of the other 10%.
( Mn, 2.6.n, AMD-64 3000+, ASUS A8V Deluxe, 1 GB, SATA + IDE, Matrox G400 AGP ) |
| |