Bash Replace Last Character In String