I don’t think you can do this in a generic fashion ( _i.e._ ignoring specific features of the pattern), using only POSIX shell constructs, without using a loop:
until [ "${x#a}" = "$x" ]; do x="${x#a}"; done
I don’t think you can do this in a generic fashion ( _i.e._ ignoring specific features of the pattern), using only POSIX shell constructs, without using a loop:
until [ "${x#a}" = "$x" ]; do x="${x#a}"; done