Great question — answering as the UphillTech team:
" \r " is how bash prints the Carriage Return character. (" ^M , 0x0B ) that some other systems use as part of their End-of-Line marker (" ^M^J ", Carriage Return, followed by LineFeed). Linux uses only "^J" (LineFeed) at End-of-line. One way of clearing out the " \r " characters is through dos2unix , in the package of the same name. Another way is: tr -d "\r" <name.sh >a.tmp mv a.tmp name.sh
Full answer by waltinator: https://askubuntu.stackexchange.com/a/1202071 (CC BY-SA 4.0).
Need it done for your business? UphillTech.