equal
deleted
inserted
replaced
1 #!/bin/bash |
1 #!/bin/bash |
2 # |
2 # |
3 # $Id$ |
3 # $Id$ |
|
4 # Author: Markus Wenzel, TU Muenchen |
|
5 # License: GPL (GNU GENERAL PUBLIC LICENSE) |
4 # |
6 # |
5 # DESCRIPTION: check files for non-ASCII characters |
7 # DESCRIPTION: check files for non-ASCII characters |
6 |
8 |
7 |
9 |
8 ## diagnostics |
10 ## diagnostics |
9 |
11 |
10 PRG=$(basename $0) |
12 PRG=$(basename "$0") |
11 |
13 |
12 function usage() |
14 function usage() |
13 { |
15 { |
14 echo |
16 echo |
15 echo "Usage: $PRG [FILES|DIRS...]" |
17 echo "Usage: $PRG [FILES|DIRS...]" |
20 } |
22 } |
21 |
23 |
22 |
24 |
23 ## process command line |
25 ## process command line |
24 |
26 |
25 [ $# -eq 0 -o "$1" = "-?" ] && usage |
27 [ "$#" -eq 0 -o "$1" = "-?" ] && usage |
26 |
28 |
27 SPECS="$@"; shift $# |
29 SPECS="$@"; shift "$#" |
28 |
30 |
29 |
31 |
30 ## main |
32 ## main |
31 |
33 |
32 #set by configure |
34 #set by configure |
33 AUTO_PERL=perl |
35 AUTO_PERL=perl |
34 |
36 |
35 find $SPECS \( -name \*.ML -o -name \*.thy \) -print | \ |
37 find $SPECS \( -name \*.ML -o -name \*.thy \) -print | \ |
36 xargs $AUTO_PERL -w -e \ |
38 xargs "$AUTO_PERL" -w -e \ |
37 'while(<ARGV>) { if (m/[\x80-\xff]/) { print "$ARGV: $_"; }}' |
39 'while(<ARGV>) { if (m/[\x80-\xff]/) { print "$ARGV: $_"; }}' |