Created
April 4, 2014 05:04
-
-
Save kylekellogg/9968494 to your computer and use it in GitHub Desktop.
Recursive sed based solution for converting line endings from Unix to DOS format
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
#!/usr/bin/env bash | |
for /r %%i in (*) do ( | |
pushd "%%i" | |
for /f in (dir /b * 2^>nul) do ( | |
# Something similar to the above using this below sed command | |
if [[ -f $file ]] | |
then | |
#sed "s/$//" | |
echo "Converting $file" | |
else | |
echo "Skipping $file" | |
fi | |
) | |
popd | |
) |
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
#!/usr/bin/env bash | |
for file in $(find . -type f -path "./*") | |
do | |
if [[ -f $file ]] | |
then | |
#sed 's/.$//' $file | |
echo "Converting $file" | |
else | |
echo "Skipping $file" | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment