Kristin recently had a script that, for some mysterious reason, was in Windows format! (the error output obviously indicated the presence of carriage returns!). In my troubleshooting, this was the command that fixed it!

  • tr -d ‘\15\32’ fixed_script.sh



Suggested Citation:
Sochat, Vanessa. "Get rid of carriage returns using tr." @vsoch (blog), 11 Sep 2010, https://vsoch.github.io/2010/get-rid-of-carriage-returns-using-tr/ (accessed 18 Nov 24).