case "$1","$name" in -py | --python | --python3,*) if [[ "$name" =~ \..+$ ]]; then That doesn't catch stuff, which actually it should, like…
USERNAME@HOSTNAME:~$ myscript --python surfer Funny thing: Simplify the multi pattern conditional to…
--python,*) if [[ "$name" =~ \..+$ ]]; then and it works! With the bitterly-repetitive outlook to have to place that section 3 times: 1st for -py, then for --python, and finally for --python3 for catching all patterns.
But the other thing is - the other way around:
case "$1" in -py | --python | --python3) if [[ ! "$name" =~ \.py$ ]]; then That's fine, that works! So, that disproves my assumption, that the multi pattern syntax might be incorrect, might needs the spaces to be removed, or any kind of bracket around the sum of all 3 patterns to be interpreted as a group, where the first OR the second OR the third pattern is supposed to be catched.
And with all this I really have the impression, that you can't have both in GNU bash, version 4.3, multi pattern AND aside of that conditional a second conditional like "$name". Could that be? Or have I made a mistake in trying to acchieve that?
-py | --python | --python3,*means-pyor--pythonor--python3,*.--python,surferdoesn’t match any of those patterns.casestatements don't have anything as fancy. It feels a bit surprising even alternation is there.