s to a number less than zero counts back from the end of the expanded value of $param.
When a negativ... er
<code>
a=12345678
echo ${a:-4}
</code>
intending to print the last four characters of $a. The ... ${variable%pattern}
If the pattern matches the end of the variable's value, delete the shortest part... ${variable%%pattern}
If the pattern matches the end of the variable's value, delete the longest part