Skip to content

Instantly share code, notes, and snippets.

@timwhitlock
Created February 3, 2011 11:40
Show Gist options
  • Save timwhitlock/809384 to your computer and use it in GitHub Desktop.
Save timwhitlock/809384 to your computer and use it in GitHub Desktop.
#!/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