lib/Tools/nonascii
author paulson
Wed, 02 Dec 1998 15:53:05 +0100
changeset 6006 d2e271b8d651
parent 4508 f102cb0140fe
child 6082 590f9e3bf4d8
permissions -rwxr-xr-x
new rule rev_bexI
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
4193
a8e252c91dba check files for non-ASCII characters;
wenzelm
parents:
diff changeset
     1
#!/bin/bash
a8e252c91dba check files for non-ASCII characters;
wenzelm
parents:
diff changeset
     2
#
a8e252c91dba check files for non-ASCII characters;
wenzelm
parents:
diff changeset
     3
# $Id$
a8e252c91dba check files for non-ASCII characters;
wenzelm
parents:
diff changeset
     4
#
a8e252c91dba check files for non-ASCII characters;
wenzelm
parents:
diff changeset
     5
# DESCRIPTION: check files for non-ASCII characters
a8e252c91dba check files for non-ASCII characters;
wenzelm
parents:
diff changeset
     6
a8e252c91dba check files for non-ASCII characters;
wenzelm
parents:
diff changeset
     7
a8e252c91dba check files for non-ASCII characters;
wenzelm
parents:
diff changeset
     8
## diagnostics
a8e252c91dba check files for non-ASCII characters;
wenzelm
parents:
diff changeset
     9
a8e252c91dba check files for non-ASCII characters;
wenzelm
parents:
diff changeset
    10
PRG=$(basename $0)
a8e252c91dba check files for non-ASCII characters;
wenzelm
parents:
diff changeset
    11
a8e252c91dba check files for non-ASCII characters;
wenzelm
parents:
diff changeset
    12
function usage()
a8e252c91dba check files for non-ASCII characters;
wenzelm
parents:
diff changeset
    13
{
a8e252c91dba check files for non-ASCII characters;
wenzelm
parents:
diff changeset
    14
  echo
a8e252c91dba check files for non-ASCII characters;
wenzelm
parents:
diff changeset
    15
  echo "Usage: $PRG [FILES|DIRS...]"
a8e252c91dba check files for non-ASCII characters;
wenzelm
parents:
diff changeset
    16
  echo
a8e252c91dba check files for non-ASCII characters;
wenzelm
parents:
diff changeset
    17
  echo "  Recursively find .thy/.ML files and check for non-ASCII characters."
a8e252c91dba check files for non-ASCII characters;
wenzelm
parents:
diff changeset
    18
  echo
a8e252c91dba check files for non-ASCII characters;
wenzelm
parents:
diff changeset
    19
  exit 1
a8e252c91dba check files for non-ASCII characters;
wenzelm
parents:
diff changeset
    20
}
a8e252c91dba check files for non-ASCII characters;
wenzelm
parents:
diff changeset
    21
a8e252c91dba check files for non-ASCII characters;
wenzelm
parents:
diff changeset
    22
a8e252c91dba check files for non-ASCII characters;
wenzelm
parents:
diff changeset
    23
## process command line
a8e252c91dba check files for non-ASCII characters;
wenzelm
parents:
diff changeset
    24
a8e252c91dba check files for non-ASCII characters;
wenzelm
parents:
diff changeset
    25
[ $# -eq 0 -o "$1" = "-?" ] && usage
a8e252c91dba check files for non-ASCII characters;
wenzelm
parents:
diff changeset
    26
a8e252c91dba check files for non-ASCII characters;
wenzelm
parents:
diff changeset
    27
SPECS="$@"; shift $#
a8e252c91dba check files for non-ASCII characters;
wenzelm
parents:
diff changeset
    28
a8e252c91dba check files for non-ASCII characters;
wenzelm
parents:
diff changeset
    29
a8e252c91dba check files for non-ASCII characters;
wenzelm
parents:
diff changeset
    30
## main
a8e252c91dba check files for non-ASCII characters;
wenzelm
parents:
diff changeset
    31
4508
f102cb0140fe do require perl;
wenzelm
parents: 4193
diff changeset
    32
find $SPECS \( -name \*.ML -o -name \*.thy \) -print | \
f102cb0140fe do require perl;
wenzelm
parents: 4193
diff changeset
    33
  xargs perl -w -e \
f102cb0140fe do require perl;
wenzelm
parents: 4193
diff changeset
    34
    'while(<ARGV>) { if (m/[\x80-\xff]/) { print "$ARGV: $_"; }}'