File: cr.sh

package info (click to toggle)
fldigi 4.2.11-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 24,600 kB
  • sloc: cpp: 282,156; ansic: 96,034; sh: 5,275; makefile: 1,152; sed: 16
file content (20 lines) | stat: -rwxr-xr-x 547 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/sh

# Check for files with CRLF line terminators

r=0
for f in $fldigi_SOURCES $flarq_SOURCES $EXTRA_fldigi_SOURCES $EXTRA_DIST; do
    base=$(echo $f | sed -n '/\.[cC][cCpPxX]\{1,\}/ { s!.*/\(.*\)\.[^.]*$!\1!p; }')
    if test "x$base" != "x" && grep "
" "${srcdir}/${f}" >/dev/null; then
        echo "E: $f has CRLF line terminators" >&2
        r=1
    fi
done

if [ $r -eq 1 ]; then
    echo "Please remove the CRs from the above file(s)." 2>&1
    echo "You can use something like:  sed -i 's/\r$//' FILE1 FILE2 ..." 2>&1
fi

exit $r