mirror of https://github.com/mkerrisk/man-pages
minor fixes
This commit is contained in:
parent
ad4dd40414
commit
3511dcdbf5
|
@ -23,14 +23,14 @@ while getopts "a" optname; do
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
shift $(( OPTIND - 1 ))
|
shift $(( $OPTIND - 1 ))
|
||||||
|
|
||||||
if test $# -eq 0; then
|
if test $# -eq 0; then
|
||||||
echo "Usage: $0 [-a] pathname" 1>&2
|
echo "Usage: $0 [-a] pathname" 1>&2
|
||||||
exit 1;
|
exit 1;
|
||||||
fi
|
fi
|
||||||
for dir in "$@";
|
|
||||||
do
|
for dir in "$@"; do
|
||||||
for page in $(find "$dir" -type f -name '*.[1-9]' \
|
for page in $(find "$dir" -type f -name '*.[1-9]' \
|
||||||
-exec grep -l FIXME {} \; | sort)
|
-exec grep -l FIXME {} \; | sort)
|
||||||
do
|
do
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
# Try to substitute instances of that name on the page.
|
# Try to substitute instances of that name on the page.
|
||||||
# (instances are considered to be words formatted
|
# (instances are considered to be words formatted
|
||||||
# using ^.[BI] or \f[BI]...\f[PR] -- this script
|
# using ^.[BI] or \f[BI]...\f[PR] -- this script
|
||||||
# ignores unformatted instances on function names.)
|
# ignores unformatted instances of function names.)
|
||||||
# fi
|
# fi
|
||||||
# done
|
# done
|
||||||
# done
|
# done
|
||||||
|
@ -81,11 +81,11 @@ while getopts "n" optname; do
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
shift $(( OPTIND - 1 ))
|
shift $(( $OPTIND - 1 ))
|
||||||
|
|
||||||
# Only process files with > 1 line -- single-line files are link files
|
# 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
|
grep -v '^total'); do
|
||||||
|
|
||||||
echo ">>>>>>>>>>>>>>>>>>>>>>>>>" $page "<<<<<<<<<<<<<<<<<<<<<<<<<"
|
echo ">>>>>>>>>>>>>>>>>>>>>>>>>" $page "<<<<<<<<<<<<<<<<<<<<<<<<<"
|
||||||
|
@ -96,10 +96,10 @@ for page in $(wc $* 2> /dev/null | awk '$1 > 1 {print $4}'| \
|
||||||
|
|
||||||
sh_nlist=$(cat $page | \
|
sh_nlist=$(cat $page | \
|
||||||
awk 'BEGIN { p = 0 }
|
awk 'BEGIN { p = 0 }
|
||||||
/^\.SH NAME/ { p = NR }
|
/^\.SH NAME/ { p = NR }
|
||||||
/^.SH/ && NR > p { p = 0 } # Stop at the next .SH directive
|
/^.SH/ && NR > p { p = 0 } # Stop at the next .SH directive
|
||||||
p > 0 && NR > p {print $0} # These are the lines between
|
p > 0 && NR > p { print $0 } # These are the lines between
|
||||||
# the two .SH directives
|
# the two .SH directives
|
||||||
')
|
')
|
||||||
sh_nlist=$(echo $sh_nlist | sed -e 's/ *\\-.*//' -e 's/, */ /g')
|
sh_nlist=$(echo $sh_nlist | sed -e 's/ *\\-.*//' -e 's/, */ /g')
|
||||||
echo "### .SH name list:" $sh_nlist
|
echo "### .SH name list:" $sh_nlist
|
||||||
|
|
|
@ -40,6 +40,7 @@ rm -f $awk_script_file
|
||||||
|
|
||||||
# We grep out a few page names that are likely to generate false
|
# We grep out a few page names that are likely to generate false
|
||||||
# positives...
|
# positives...
|
||||||
|
|
||||||
echo '{' >> $awk_script_file
|
echo '{' >> $awk_script_file
|
||||||
echo ' myvar = $2;' >> $awk_script_file
|
echo ' myvar = $2;' >> $awk_script_file
|
||||||
echo ' gsub("[^a-z_0-9]*$", "", myvar);' >> $awk_script_file
|
echo ' gsub("[^a-z_0-9]*$", "", myvar);' >> $awk_script_file
|
||||||
|
|
|
@ -41,11 +41,11 @@ while getopts "n" optname; do
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
shift $(( OPTIND - 1 ))
|
shift $(( $OPTIND - 1 ))
|
||||||
|
|
||||||
# Only process files with > 1 line -- single-line files are link files
|
# 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
|
grep -v '^total'); do
|
||||||
|
|
||||||
cp $page $work_dst_file
|
cp $page $work_dst_file
|
||||||
|
|
Loading…
Reference in New Issue