lib/Tools/nonascii
author wenzelm
Sat, 24 Nov 2001 16:54:32 +0100
changeset 12282 f98beaaa7c4f
parent 10555 2323ec838401
permissions -rwxr-xr-x
generic_merge;
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
10555
2323ec838401 /usr/bin/env bash;
wenzelm
parents: 10511
diff changeset
     1
#!/usr/bin/env bash
4193
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$
9788
wenzelm
parents: 6082
diff changeset
     4
# Author: Markus Wenzel, TU Muenchen
wenzelm
parents: 6082
diff changeset
     5
# License: GPL (GNU GENERAL PUBLIC LICENSE)
4193
a8e252c91dba check files for non-ASCII characters;
wenzelm
parents:
diff changeset
     6
#
a8e252c91dba check files for non-ASCII characters;
wenzelm
parents:
diff changeset
     7
# DESCRIPTION: check files for non-ASCII characters
a8e252c91dba check files for non-ASCII characters;
wenzelm
parents:
diff changeset
     8
a8e252c91dba check files for non-ASCII characters;
wenzelm
parents:
diff changeset
     9
a8e252c91dba check files for non-ASCII characters;
wenzelm
parents:
diff changeset
    10
## diagnostics
a8e252c91dba check files for non-ASCII characters;
wenzelm
parents:
diff changeset
    11
10511
wenzelm
parents: 9788
diff changeset
    12
PRG="$(basename "$0")"
4193
a8e252c91dba check files for non-ASCII characters;
wenzelm
parents:
diff changeset
    13
a8e252c91dba check files for non-ASCII characters;
wenzelm
parents:
diff changeset
    14
function usage()
a8e252c91dba check files for non-ASCII characters;
wenzelm
parents:
diff changeset
    15
{
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 "Usage: $PRG [FILES|DIRS...]"
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
  echo "  Recursively find .thy/.ML files and check for non-ASCII characters."
a8e252c91dba check files for non-ASCII characters;
wenzelm
parents:
diff changeset
    20
  echo
a8e252c91dba check files for non-ASCII characters;
wenzelm
parents:
diff changeset
    21
  exit 1
a8e252c91dba check files for non-ASCII characters;
wenzelm
parents:
diff changeset
    22
}
a8e252c91dba check files for non-ASCII characters;
wenzelm
parents:
diff changeset
    23
a8e252c91dba check files for non-ASCII characters;
wenzelm
parents:
diff changeset
    24
a8e252c91dba check files for non-ASCII characters;
wenzelm
parents:
diff changeset
    25
## process command line
a8e252c91dba check files for non-ASCII characters;
wenzelm
parents:
diff changeset
    26
9788
wenzelm
parents: 6082
diff changeset
    27
[ "$#" -eq 0 -o "$1" = "-?" ] && usage
4193
a8e252c91dba check files for non-ASCII characters;
wenzelm
parents:
diff changeset
    28
9788
wenzelm
parents: 6082
diff changeset
    29
SPECS="$@"; shift "$#"
4193
a8e252c91dba check files for non-ASCII characters;
wenzelm
parents:
diff changeset
    30
a8e252c91dba check files for non-ASCII characters;
wenzelm
parents:
diff changeset
    31
a8e252c91dba check files for non-ASCII characters;
wenzelm
parents:
diff changeset
    32
## main
a8e252c91dba check files for non-ASCII characters;
wenzelm
parents:
diff changeset
    33
6082
590f9e3bf4d8 configure AUTO_BASH, AUTO_PERL;
wenzelm
parents: 4508
diff changeset
    34
#set by configure
590f9e3bf4d8 configure AUTO_BASH, AUTO_PERL;
wenzelm
parents: 4508
diff changeset
    35
AUTO_PERL=perl
590f9e3bf4d8 configure AUTO_BASH, AUTO_PERL;
wenzelm
parents: 4508
diff changeset
    36
4508
f102cb0140fe do require perl;
wenzelm
parents: 4193
diff changeset
    37
find $SPECS \( -name \*.ML -o -name \*.thy \) -print | \
9788
wenzelm
parents: 6082
diff changeset
    38
  xargs "$AUTO_PERL" -w -e \
4508
f102cb0140fe do require perl;
wenzelm
parents: 4193
diff changeset
    39
    'while(<ARGV>) { if (m/[\x80-\xff]/) { print "$ARGV: $_"; }}'