Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

4
  • 1
    I was preparing a similar answer using ;;& but i was late! +1 for the nice answer :-) You can also fake a kind of and using something like [0-9]*);;&*[0-9]) echo "word begins and ends with number";; Commented Oct 28, 2019 at 18:15
  • Thanks @jeff-schaller for the explanation, also I have corrected my question after George pointed out about the incorrect placement of "words begins/ends with" part. Commented Oct 28, 2019 at 18:51
  • 1
    Note that zsh had ;| (also supported by mksh) before (2007) bash added ;;& (2009) for the same thing (;& itself comes from ksh88e, added to zsh in 1997 and bash in 2009). Commented Oct 29, 2019 at 16:25
  • 1
    For booleans (0 or 1) A and B, the usual solution is case $A$B in 11) .... . Simpler. Commented Oct 30, 2019 at 17:00