File: fix_eol.sh

package info (click to toggle)
monkeystudio 1.9.0.4%2Bgit20161218-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 41,500 kB
  • ctags: 22,118
  • sloc: cpp: 144,671; ansic: 33,969; python: 2,922; makefile: 127; sh: 122; php: 73; cs: 69
file content (20 lines) | stat: -rwxr-xr-x 529 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/sh

# this script convert eol to unix eol.

if [ -z "$1" ]; then
    echo "Please give the folder to check as first parameter."
    exit 1
fi

CUR_PATH=$PWD

cd "$1"

find . -type f -name "*.h*" -o -name "*.c*" -o -name "*.ini" -o -name "*.txt" -o -name "*.rc" -o -name "*.conf" -o -name "*.iss" -o -name "*.py" -o -name "*.sh" -o -name "*.mks" -o -name "*.pri" -o -name "*.pro" -o -name "*.xup" | grep -v .svn | while read line
do
    dos2unix --newfile "$line" "$line.new"
    mv "$line.new" "$line"
done

cd "$CUR_PATH"