Skip to content

Instantly share code, notes, and snippets.

@andrewmarmion
Forked from jappy/dos2unix.sh
Created August 20, 2018 11:27
Show Gist options
  • Select an option

  • Save andrewmarmion/29ac05d99e713e7b4078ea3d3b9ac79e to your computer and use it in GitHub Desktop.

Select an option

Save andrewmarmion/29ac05d99e713e7b4078ea3d3b9ac79e to your computer and use it in GitHub Desktop.
Shell script to convert files with CRLF to LF (Mac/Linux)
#! /bin/sh
for x
do
echo "Converting $x"
tr -d '\015' < "$x" > "tmp.$x"
mv "tmp.$x" "$x"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment