blob: db45f6ac698c6dab2dd95e061f99342aebb8fdae [file] [log] [blame]
Andrew Grimbergebc710a2017-01-30 12:59:38 -08001#!/bin/bash
2
3# @License EPL-1.0 <http://spdx.org/licenses/EPL-1.0>
4##############################################################################
5# Copyright (c) 2015 The Linux Foundation and others.
6#
7# All rights reserved. This program and the accompanying materials
8# are made available under the terms of the Eclipse Public License v1.0
9# which accompanies this distribution, and is available at
10# http://www.eclipse.org/legal/epl-v10.html
11#
12# Contributors:
13# Thanh Ha (The Linux Foundation) - Initial implementation
14##############################################################################
15
16directory="."
17if [ ! -z "$1" ]; then
18 directory="$1"
19fi
20
21echo "Scanning $directory"
22for x in $(find $directory -type f); do
23 if LC_ALL=C grep -q '[^[:print:][:space:]]' "$x"; then
24 echo "file "$x" contains non-ascii characters"
25 exit 1
26 fi
27done
28
29echo "All files are ASCII only"