These are documented in
ksh(1):
Code:
The following forms of parameter substitution can also be used:
[snip]
${name#pattern}
${name##pattern}
If pattern matches the beginning of the value of parameter name,
the matched text is deleted from the result of substitution. A
single `#' results in the shortest match, and two of them result
in the longest match.
${name%pattern}
${name%%pattern}
Like ${..#..} substitution, but it deletes from the end of the
value.
From
sh(1):
Code:
${parameter%[word]}
Substitute parameter, deleting the smallest possible suffix
matching word.
${parameter%%[word]}
Substitute parameter, deleting the largest possible suffix
matching word.
${parameter#[word]}
Substitute parameter, deleting the smallest possible prefix
matching word.
${parameter##[word]}
Substitute parameter, deleting the largest possible prefix
matching word.