Skip to content

Instantly share code, notes, and snippets.

@PetrGlad
Created September 28, 2017 10:22
Show Gist options
  • Save PetrGlad/9bbea3be49efc0f3bd89898f8a557e09 to your computer and use it in GitHub Desktop.
Save PetrGlad/9bbea3be49efc0f3bd89898f8a557e09 to your computer and use it in GitHub Desktop.
Trim line ends
#!/bin/bash
set -e -x
FILE=$1
BAK=$FILE.eol.bak
cp $FILE $BAK
cat $BAK | sed -r "s/[ \t]+$//" > $FILE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment