Is there a way to do the [default values `${foo:-bar}`](http://www.gnu.org/software/bash/manual/bashref.html#Shell-Parameter-Expansion) and the [remove matching suffix `${foo%bar}`](http://www.gnu.org/software/bash/manual/bashref.html#Shell-Parameter-Expansion) bash feature in the same time ?

Something like that: `${foo%suffix:-default}`

In other words, I want:

* If `foo` is unset or null use the `default` value
* If `foo` is set remove any `suffix` at the end