Title: Delete last chars from a string
Author: Sandro Tosi
Last modified: 2005-08-13
We can force the module operator of a bash shell, `%', to be used with
string. This way we can cut away chars from the end of a string; here
an example is better than other words:
$ string=abcde.aaab
$ echo ${string%.aaab}
abcde
$ echo ${string%ab}
abcde.aa
$ echo ${string%aab}
abcde.a
$ echo ${string%abc}
abcde.aaab
|