Created
April 19, 2016 09:20
-
-
Save dodocat/633320159964dd67744d1a40d31db0b2 to your computer and use it in GitHub Desktop.
Convert dos \n\r to unix \n
This file contains hidden or 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 | |
| showUsage() | |
| { | |
| echo "Usage: dos2unixdir [destdir]" | |
| exit 0 | |
| } | |
| dir=$PWD | |
| if [ $# -gt 1 ] | |
| then | |
| showUsage | |
| fi | |
| if [ $# -gt 0 ] | |
| then | |
| dir=$1 | |
| fi | |
| for i in `find $dir` | |
| do | |
| if [ ! -d $i ] | |
| then | |
| echo "processing file..." $i | |
| dos2unix $i $i | |
| fi | |
| done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment