[bash] How to remove last n characters from a string in Bash?