[[ "$a" = [highlight]*[/highlight]@(abc) ]] && echo ends with abc
[gray]# or just[/gray]
[[ "$a" = [highlight]*[/highlight]abc ]] && echo ends with abc
I think you misunderstood the meaning of [tt]@(...)[/tt] sub-patterns. They are meaningful when they enclose a pattern-list ( as man calls them ), so something that describes multiple alternatives, like [tt]@(foo|bar)[/tt] or [tt]@([aeiou])[/tt].
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.