minor fixes

This commit is contained in:
Michael Kerrisk 2007-06-09 12:41:40 +00:00
parent ad4dd40414
commit 3511dcdbf5
4 changed files with 13 additions and 12 deletions

View File

@ -23,14 +23,14 @@ while getopts "a" optname; do
esac
done
shift $(( OPTIND - 1 ))
shift $(( $OPTIND - 1 ))
if test $# -eq 0; then
echo "Usage: $0 [-a] pathname" 1>&2
exit 1;
fi
for dir in "$@";
do
for dir in "$@"; do
for page in $(find "$dir" -type f -name '*.[1-9]' \
-exec grep -l FIXME {} \; | sort)
do

View File

@ -19,7 +19,7 @@
# Try to substitute instances of that name on the page.
# (instances are considered to be words formatted
# using ^.[BI] or \f[BI]...\f[PR] -- this script
# ignores unformatted instances on function names.)
# ignores unformatted instances of function names.)
# fi
# done
# done
@ -81,11 +81,11 @@ while getopts "n" optname; do
esac
done
shift $(( OPTIND - 1 ))
shift $(( $OPTIND - 1 ))
# Only process files with > 1 line -- single-line files are link files
for page in $(wc $* 2> /dev/null | awk '$1 > 1 {print $4}'| \
for page in $(wc "$@" 2> /dev/null | awk '$1 > 1 {print $4}'| \
grep -v '^total'); do
echo ">>>>>>>>>>>>>>>>>>>>>>>>>" $page "<<<<<<<<<<<<<<<<<<<<<<<<<"
@ -96,10 +96,10 @@ for page in $(wc $* 2> /dev/null | awk '$1 > 1 {print $4}'| \
sh_nlist=$(cat $page | \
awk 'BEGIN { p = 0 }
/^\.SH NAME/ { p = NR }
/^.SH/ && NR > p { p = 0 } # Stop at the next .SH directive
p > 0 && NR > p {print $0} # These are the lines between
# the two .SH directives
/^\.SH NAME/ { p = NR }
/^.SH/ && NR > p { p = 0 } # Stop at the next .SH directive
p > 0 && NR > p { print $0 } # These are the lines between
# the two .SH directives
')
sh_nlist=$(echo $sh_nlist | sed -e 's/ *\\-.*//' -e 's/, */ /g')
echo "### .SH name list:" $sh_nlist

View File

@ -40,6 +40,7 @@ rm -f $awk_script_file
# We grep out a few page names that are likely to generate false
# positives...
echo '{' >> $awk_script_file
echo ' myvar = $2;' >> $awk_script_file
echo ' gsub("[^a-z_0-9]*$", "", myvar);' >> $awk_script_file

View File

@ -41,11 +41,11 @@ while getopts "n" optname; do
esac
done
shift $(( OPTIND - 1 ))
shift $(( $OPTIND - 1 ))
# Only process files with > 1 line -- single-line files are link files
for page in $(wc $* 2> /dev/null | awk '$1 > 1 {print $4}'| \
for page in $(wc "$@" 2> /dev/null | awk '$1 > 1 {print $4}'| \
grep -v '^total'); do
cp $page $work_dst_file