Created
February 3, 2011 11:40
-
-
Save timwhitlock/809384 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# dos2unix utility using translate characters command | |
# requires /usr/bin/tr | |
for f in "$@" | |
do | |
if [ -f "$f" ]; then | |
echo "dos2unix $f" | |
cat $f | /usr/bin/tr -d "\015" > "$f.tmp" | |
mv "$f.tmp" "$f" | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment