[lang-ref] ( remove_suffix ) ( bash )
@test "remove suffix" {
# ${text%suffix}
text="abcdefghijk"
suffix="ijk"
[ "${text%ijk}" == "abcdefgh" ]
# variable is allowed in pattern
[ "${text%$suffix}" == "abcdefgh" ]
}
@test "remove suffix" {
# ${text%suffix}
text="abcdefghijk"
suffix="ijk"
[ "${text%ijk}" == "abcdefgh" ]
# variable is allowed in pattern
[ "${text%$suffix}" == "abcdefgh" ]
}