Skip to content

Instantly share code, notes, and snippets.

@druid628
Last active October 30, 2019 18:39
Show Gist options
  • Save druid628/1345812 to your computer and use it in GitHub Desktop.
Save druid628/1345812 to your computer and use it in GitHub Desktop.
Perl 1-Liner to remove dos line endings from a file (all the while backing it up)
#NOTE: ^M -- To get the ^M you must use <CTRL+V><CTRL+M>
#
# $ perl -p -i.bak -e "s/^M//g" <FILENAME>
#
#Creates a <FILENAME>.bak file and removes the DOS line ending (^M)
perl -p -i.bak -e "s/^M//g" <FILENAME>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment