This is true for any shell that supports the variable expansions specified by the POSIX standards and the Single UNIX Specifications for a variable that contains at least two "a" characters. The C shell ( csh ) and related shells usually do not support ${varOPpattern} expansions where OP is # , ## , % , or %% .