>>966
$ man sh

${parameter%word}
Remove Smallest Suffix Pattern. The word is expanded to produce
a pattern. The parameter expansion then results in parameter,
with the smallest portion of the suffix matched by the pattern
deleted.

${parameter%%word}
Remove Largest Suffix Pattern. The word is expanded to produce a
pattern. The parameter expansion then results in parameter, with
the largest portion of the suffix matched by the pattern deleted.

${parameter#word}
Remove Smallest Prefix Pattern. The word is expanded to produce
a pattern. The parameter expansion then results in parameter,
with the smallest portion of the prefix matched by the pattern
deleted.

${parameter##word}
Remove Largest Prefix Pattern. The word is expanded to produce a
pattern. The parameter expansion then results in parameter, with
the largest portion of the prefix matched by the pattern deleted.