3 LOG
=/tmp
/markup_check.$$
7 echo 1>&2 "Usage: $0 filename-or-dirname ... $#"
11 file_list
=$
(find $
* -type f |
grep '\.[1-9][a-zA-Z]*$')
13 pagename_pattern
='[a-z_A-Z][^ ]*'
17 echo "Checking for page xref without space before left parenthesis:"
18 pattern
='^\.BR *'"$pagename_pattern"'([1-8][^1-9]'
19 echo " Pattern: '$pattern'"
20 grep "$pattern" $file_list |
sed 's/^/ /' |
tee -a $LOG
23 echo "Checking for .IR xrefs that should be .BR"
24 pattern
='^\.IR *'"$pagename_pattern"' *([1-8][^1-9]'
25 echo " Pattern: '$pattern'"
26 grep "$pattern" $file_list |
sed 's/^/ /' |
tee -a $LOG
29 echo "Checking for misformatted punctuation in .BR xrefs"
30 pattern
='^\.BR *'"$pagename_pattern"' *([1-8a-zA-Z]*) [^ ]'
31 echo " Pattern: '$pattern'"
32 grep "$pattern" $file_list |
sed 's/^/ /' |
tee -a $LOG
35 echo "Checking for .B xrefs that should be .BR"
36 pattern
='^\.B '"$pagename_pattern"' *([1-8a-zA-Z]*)'
37 echo " Pattern: '$pattern'"
38 grep "$pattern" $file_list |
sed 's/^/ /' |
tee -a $LOG
41 if test $
(cat $LOG |
wc -l) -gt 0; then
43 echo "MARKUP ERRORS!!!!!"