Skip to content

Instantly share code, notes, and snippets.

@Ravendwyr
Created August 8, 2013 11:17
Show Gist options
  • Save Ravendwyr/6183778 to your computer and use it in GitHub Desktop.
Save Ravendwyr/6183778 to your computer and use it in GitHub Desktop.
Convert all files in a directory from Window-style line endings to Unix-style.
#! /bin/sh
echo "Beginning conversion..."
for x do
echo "Converting $x..."
tr -d '\015' < "$x" > "$x.new"
mv "$x.new" "$x"
done
echo "Conversion complete."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment