X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=scripts%2Fcheck-unicode.sh;h=931c99fac8a2c9d9c38369d372bdac6a4c7e7dc8;hb=f773b83553de441a25e474907afe5647e379c847;hp=cb0af7215361776612e8cc117f34cb0491c3322f;hpb=183148768c993ec99220e1143e4a56d604f2faac;p=releng%2Fbuilder.git diff --git a/scripts/check-unicode.sh b/scripts/check-unicode.sh index cb0af7215..931c99fac 100755 --- a/scripts/check-unicode.sh +++ b/scripts/check-unicode.sh @@ -13,18 +13,13 @@ # Thanh Ha (The Linux Foundation) - Initial implementation ############################################################################## -directory="." -if [ ! -z "$1" ]; then - directory="$1" -fi +directory=${1:-"."} echo "Scanning $directory" -while IFS= read -r -d '' x -do - if LC_ALL=C grep -q '[^[:print:][:space:]]' "$x"; then - echo "file $x contains non-ascii characters" - exit 1 - fi -done < <(find "$directory" -type f -print0) +if LC_ALL=C grep -r '[^[:print:][:space:]]' "$directory"; then + echo "Found files containing non-ascii characters." + exit 1 +fi echo "All files are ASCII only" +