[bash] How to remove the last character from a bash grep output