Skip to content
Snippets Groups Projects
Commit 89365786 authored by Laurent Destailleur's avatar Laurent Destailleur
Browse files

New: enhance tool fixdosfiles.sh

Convert DOS files to unix
parent 3c23a717
No related branches found
No related tags found
No related merge requests found
Showing
with 200 additions and 170 deletions
......@@ -4,12 +4,27 @@
#
# Laurent Destailleur - eldy@users.sourceforge.net
#------------------------------------------------------
# Usage: finddosfiles.sh
# Usage: fixdosfiles.sh [list|fix]
#------------------------------------------------------
# Syntax
if [ "x$1" != "xlist" -a "x$1" != "xfix" ]
then
echo "Usage: fixdosfiles.sh [list|fix]"
fi
# To detec
if [ "x$1" = "xlist" ]
then
find . -type f -iname "*.php" -exec file "{}" + | grep CRLF
fi
# To convert
#find . -type f -iname "*.php" -exec dos2unix "{}" +;
if [ "x$1" = "xfix" ]
then
for fic in `find . -type f -iname "*.php" -exec file "{}" + | grep CRLF | awk -F':' '{ print $1 }' `
do
echo "Fix file $fic"
dos2unix $fic
done;
fi
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment