Skip to content

Instantly share code, notes, and snippets.

@bmmalone
Created July 31, 2018 10:04
Show Gist options
  • Save bmmalone/048881995bc76909bb53de9c4049ffe0 to your computer and use it in GitHub Desktop.
Save bmmalone/048881995bc76909bb53de9c4049ffe0 to your computer and use it in GitHub Desktop.
Convert carriage returns to line feeds
#! /usr/bin/env bash
tr '\r' '\n' < $1 > $1.tmp
mv $1.tmp $1
@bmmalone
Copy link
Author

Old mac text files used "carriage return" to indicate a new line. This small script (motivated by dos2unix) replaces those with line feeds.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment