makewhatis from man spits errors
Elan Ruusamäe
glen at delfi.ee
Thu Feb 9 11:42:56 CET 2006
(as bugs.pld-linux.org is unusable again, posting here)
man-whatis-1.6c-2 running from cron:
# sh -x /etc/cron.daily/makewhatis
+ LOCKFILE=/var/lock/makewhatis.lock
+ [ -f /var/lock/makewhatis.lock ]
+ touch /var/lock/makewhatis.lock
+ makewhatis -u -w
awk: line 74: syntax error at or near ||
awk: line 75: extra ')'
awk: line 78: syntax error at or near else
awk: line 81: syntax error at or near }
awk: line 151: syntax error at or near }
awk: line 74: syntax error at or near ||
awk: line 75: extra ')'
awk: line 78: syntax error at or near else
awk: line 81: syntax error at or near }
awk: line 151: syntax error at or near }
awk: line 74: syntax error at or near ||
awk: line 75: extra ')'
awk: line 78: syntax error at or near else
awk: line 81: syntax error at or near }
awk: line 151: syntax error at or near }
awk: line 74: syntax error at or near ||
awk: line 75: extra ')'
awk: line 78: syntax error at or near else
awk: line 81: syntax error at or near }
awk: line 151: syntax error at or near }
awk: line 74: syntax error at or near ||
awk: line 75: extra ')'
awk: line 78: syntax error at or near else
awk: line 81: syntax error at or near }
awk: line 151: syntax error at or near }
awk: line 74: syntax error at or near ||
awk: line 75: extra ')'
awk: line 78: syntax error at or near else
awk: line 81: syntax error at or near }
awk: line 151: syntax error at or near }
awk: line 74: syntax error at or near ||
awk: line 75: extra ')'
awk: line 78: syntax error at or near else
awk: line 81: syntax error at or near }
awk: line 151: syntax error at or near }
awk: line 74: syntax error at or near ||
awk: line 75: extra ')'
awk: line 78: syntax error at or near else
awk: line 81: syntax error at or near }
awk: line 151: syntax error at or near }
awk: line 74: syntax error at or near ||
awk: line 75: extra ')'
awk: line 78: syntax error at or near else
awk: line 81: syntax error at or near }
awk: line 151: syntax error at or near }
awk: line 74: syntax error at or near ||
awk: line 75: extra ')'
awk: line 78: syntax error at or near else
awk: line 81: syntax error at or near }
awk: line 151: syntax error at or near }
awk: line 74: syntax error at or near ||
awk: line 75: extra ')'
awk: line 78: syntax error at or near else
awk: line 81: syntax error at or near }
awk: line 151: syntax error at or near }
awk: line 74: syntax error at or near ||
awk: line 75: extra ')'
awk: line 78: syntax error at or near else
awk: line 81: syntax error at or near }
awk: line 151: syntax error at or near }
awk: line 74: syntax error at or near ||
awk: line 75: extra ')'
awk: line 78: syntax error at or near else
awk: line 81: syntax error at or near }
awk: line 151: syntax error at or near }
awk: line 74: syntax error at or near ||
awk: line 75: extra ')'
awk: line 78: syntax error at or near else
awk: line 81: syntax error at or near }
awk: line 151: syntax error at or near }
awk: line 74: syntax error at or near ||
awk: line 75: extra ')'
awk: line 78: syntax error at or near else
awk: line 81: syntax error at or near }
awk: line 151: syntax error at or near }
awk: line 74: syntax error at or near ||
awk: line 75: extra ')'
awk: line 78: syntax error at or near else
awk: line 81: syntax error at or near }
awk: line 151: syntax error at or near }
awk: line 74: syntax error at or near ||
awk: line 75: extra ')'
awk: line 78: syntax error at or near else
awk: line 81: syntax error at or near }
awk: line 151: syntax error at or near }
awk: line 74: syntax error at or near ||
awk: line 75: extra ')'
awk: line 78: syntax error at or near else
awk: line 81: syntax error at or near }
awk: line 151: syntax error at or near }
awk: line 74: syntax error at or near ||
awk: line 75: extra ')'
awk: line 78: syntax error at or near else
awk: line 81: syntax error at or near }
awk: line 151: syntax error at or near }
awk: line 74: syntax error at or near ||
awk: line 75: extra ')'
awk: line 78: syntax error at or near else
awk: line 81: syntax error at or near }
awk: line 151: syntax error at or near }
awk: line 74: syntax error at or near ||
awk: line 75: extra ')'
awk: line 78: syntax error at or near else
awk: line 81: syntax error at or near }
awk: line 151: syntax error at or near }
awk: line 74: syntax error at or near ||
awk: line 75: extra ')'
awk: line 78: syntax error at or near else
awk: line 81: syntax error at or near }
awk: line 151: syntax error at or near }
awk: line 74: syntax error at or near ||
awk: line 75: extra ')'
awk: line 78: syntax error at or near else
awk: line 81: syntax error at or near }
awk: line 151: syntax error at or near }
awk: line 74: syntax error at or near ||
awk: line 75: extra ')'
awk: line 78: syntax error at or near else
awk: line 81: syntax error at or near }
awk: line 151: syntax error at or near }
awk: line 74: syntax error at or near ||
awk: line 75: extra ')'
awk: line 78: syntax error at or near else
awk: line 81: syntax error at or near }
awk: line 151: syntax error at or near }
awk: line 74: syntax error at or near ||
awk: line 75: extra ')'
awk: line 78: syntax error at or near else
awk: line 81: syntax error at or near }
awk: line 151: syntax error at or near }
awk: line 74: syntax error at or near ||
awk: line 75: extra ')'
awk: line 78: syntax error at or near else
awk: line 81: syntax error at or near }
awk: line 151: syntax error at or near }
awk: line 74: syntax error at or near ||
awk: line 75: extra ')'
awk: line 78: syntax error at or near else
awk: line 81: syntax error at or near }
awk: line 151: syntax error at or near }
awk: line 74: syntax error at or near ||
awk: line 75: extra ')'
awk: line 78: syntax error at or near else
awk: line 81: syntax error at or near }
awk: line 151: syntax error at or near }
awk: line 74: syntax error at or near ||
awk: line 75: extra ')'
awk: line 78: syntax error at or near else
awk: line 81: syntax error at or near }
awk: line 151: syntax error at or near }
awk: line 74: syntax error at or near ||
awk: line 75: extra ')'
awk: line 78: syntax error at or near else
awk: line 81: syntax error at or near }
awk: line 151: syntax error at or near }
awk: line 74: syntax error at or near ||
awk: line 75: extra ')'
awk: line 78: syntax error at or near else
awk: line 81: syntax error at or near }
awk: line 151: syntax error at or near }
awk: line 74: syntax error at or near ||
awk: line 75: extra ')'
awk: line 78: syntax error at or near else
awk: line 81: syntax error at or near }
awk: line 151: syntax error at or near }
awk: line 74: syntax error at or near ||
awk: line 75: extra ')'
awk: line 78: syntax error at or near else
awk: line 81: syntax error at or near }
awk: line 151: syntax error at or near }
+ rm -f /var/lock/makewhatis.lock
+ exit 0
attached also makewhatis run
--
glen
-------------- next part --------------
Script started on Thu Feb 9 12:41:42 2006
_wintersunset-root:/tmp\[32m12:41:45[0m root[[35mpts/7[0m]@wintersunset /tmp[36m#[0m sh -x /usr/sbin/makewhatis -u -w
+ basename /usr/sbin/makewhatis
+ program=makewhatis
+ dm=
+ [ -d /usr/share/man ]
+ [ x = x ]
+ dm=/usr/share/man
+ [ -d /usr/X11R6/man ]
+ [ x/usr/share/man = x ]
+ dm=/usr/share/man:/usr/X11R6/man
+ [ -d /usr/local/man ]
+ [ x/usr/share/man:/usr/X11R6/man = x ]
+ dm=/usr/share/man:/usr/X11R6/man:/usr/local/man
+ DEFMANPATH=/usr/share/man:/usr/X11R6/man:/usr/local/man
+ dc=
+ [ -d /usr/share/man/preformat ]
+ [ -d /usr/share/man ]
+ [ x = x ]
+ dc=/usr/share/man
+ DEFCATPATH=/usr/share/man
+ AWK=/bin/awk
+ rm -rf /var/tmp/tmpwhatis*
+ mktemp -d /var/tmp/tmpwhatisXXXXXX
+ TMPFILEDIR=/var/tmp/tmpwhatisrhNeCA
+ TMPFILE=/var/tmp/tmpwhatisrhNeCA/w
+ trap rm -rf /var/tmp/tmpwhatisrhNeCA 0 1 2 3 15
+ findarg0=-type f -size +0
+ topath=manpath
+ defmanpath=/usr/share/man:/usr/X11R6/man:/usr/local/man
+ defcatpath=
+ sections=1 2 3 4 5 6 7 8 9 n l
+ [ -n ]
+ findarg=-ctime 0
+ update=1
+ continue
+ [ -n ]
+ man --path
+ manpath=/usr/share/man:/usr/X11R6/man:/usr/local/share/man:/usr/local/man
+ catpath=/usr/share/man:/usr/X11R6/man:/usr/local/share/man:/usr/local/man
+ continue
+ echo /usr/share/man:/usr/X11R6/man:/usr/local/share/man:/usr/local/man
+ tr :
+ manpath=/usr/share/man /usr/X11R6/man /usr/local/share/man /usr/local/man
+ [ x/usr/share/man:/usr/X11R6/man:/usr/local/share/man:/usr/local/man = x ]
+ echo /usr/share/man:/usr/X11R6/man:/usr/local/share/man:/usr/local/man
+ tr :
+ catpath=/usr/share/man /usr/X11R6/man /usr/local/share/man /usr/local/man
+ :
+ > /var/cache/man/whatis
+ eval path=$manpath
+ path=/usr/share/man /usr/X11R6/man /usr/local/share/man /usr/local/man
+ [ x1 = x ]
+ [ ! -w /usr/share/man/. ]
+ [ x1 = x ]
+ [ ! -w /usr/X11R6/man/. ]
+ [ x1 = x ]
+ [ ! -w /usr/local/share/man/. ]
+ [ x1 = x ]
+ [ ! -w /usr/local/man/. ]
+ eval path=$catpath
+ path=/usr/share/man /usr/X11R6/man /usr/local/share/man /usr/local/man
+ [ x1 = x ]
+ [ ! -w /usr/share/man/. ]
+ [ x1 = x ]
+ [ ! -w /usr/X11R6/man/. ]
+ [ x1 = x ]
+ [ ! -w /usr/local/share/man/. ]
+ [ x1 = x ]
+ [ ! -w /usr/local/man/. ]
+ [ x != x ]
+ export pages
+ eval path=$manpath
+ path=/usr/share/man /usr/X11R6/man /usr/local/share/man /usr/local/man
+ [ x != x ]
+ [ -s /usr/share/man/whatis -a man = man -a x1 = x ]
+ pwd
+ here=/tmp
+ cd /usr/share/man
+ > /var/tmp/tmpwhatisrhNeCA/w
+ [ -d man1 ]
+ cd man1
+ section=1
+ curdir=/usr/share/man/man1
+ export section verbose curdir
+ find /usr/share/man/man1/. -name * -type f -size +0 -ctime 0 -print
+ /bin/awk
function readline() {
if (use_zcat || use_bzcat) {
result = (pipe_cmd | getline);
if (result < 0) {
print "Pipe error: " pipe_cmd " " ERRNO > "/dev/stderr";
}
} else {
result = (getline < filename);
if (result < 0) {
print "Read file error: " filename " " ERRNO > "/dev/stderr";
}
}
return result;
}
function closeline() {
if (use_zcat || use_bzcat) {
return close(pipe_cmd);
} else {
return close(filename);
}
}
function do_one() {
insh = 0; thisjoin = 1; done = 0;
entire_line = "";
if (verbose) {
print "adding " filename > "/dev/stderr"
}
use_zcat = match(filename,"\\.Z$") ||
match(filename,"\\.z$") || match(filename,"\\.gz$");
if (!use_zcat)
use_bzcat = match(filename,"\\.bz2");
if (use_zcat || use_bzcat) {
filename_no_gz = substr(filename, 0, RSTART - 1);
} else {
filename_no_gz = filename;
}
match(filename_no_gz, "/[^/]+$");
progname = substr(filename, RSTART + 1, RLENGTH - 1);
if (match(progname, "\\." section "[A-Za-z]+")) {
actual_section = substr(progname, RSTART + 1, RLENGTH - 1);
} else {
actual_section = section;
}
sub(/\..*/, "", progname);
if (use_zcat || use_bzcat) {
if (use_zcat) {
pipe_cmd = "zcat \"" filename "\"";
} else {
pipe_cmd = "bzcat \"" filename "\"";
}
# try to avoid suspicious stuff
if (filename ~ /[;&|`$(]/) {
print "ignored strange file name " filename " in " curdir > "/dev/stderr";
return;
}
}
while (!done && readline() > 0) {
gsub(/.\b/, "");
if (($1 ~ /^\.[Ss][Hh]/ &&
($2 ~ /[Nn][Aa][Mm][Ee]/ ||
$2 ~ /^JMÉNO/ || $2 ~ /^NAVN/ || $2 ~ /^NUME/ ||
$2 ~ /^BEZEICHNUNG/ || $2 ~ /^NOMBRE/ ||
$2 ~ /^NIMI/ || $2 ~ /^NOM/ || $2 ~ /^IME/ ||
$2 ~ /^N[ÉE]V/ || $2 ~ /^NAMA/ || $2 ~ /^̾Á°/ ||
$2 ~ /^̾¾Î/ || $2 ~ /^À̸§/ || $2 ~ /^NAZWA/ ||
$2 ~ /^îáú÷áîéå/ || $2 ~ /^Ãû³Æ/ || $2 ~ /^¦WºÙ/ ||
$2 ~ /^NOME/ || $2 ~ /^NAAM/) || $2 ~ /^ÈÌÅ/)) ||
(pages == "cat" && $1 ~ /^NAME/)) {
if (!insh) {
insh = 1;
} else {
done = 1;
}
} else if (insh) {
if ($1 ~ /^\.[Ss][HhYS]/ ||
(pages == "cat" &&
($1 ~ /^S[yYeE]/ || $1 ~ /^DESCRIPTION/ ||
$1 ~ /^COMMAND/ || $1 ~ /^OVERVIEW/ ||
$1 ~ /^STRUCTURES/ || $1 ~ /^INTRODUCTION/ ||
$0 ~ /^[^ ]/))) {
# end insh for Synopsis, Syntax, but also for
# DESCRIPTION (e.g., XFree86.1x),
# COMMAND (e.g., xspread.1)
# OVERVIEW (e.g., TclCommandWriting.3)
# STRUCTURES (e.g., XEvent.3x)
# INTRODUCTION (e.g., TclX.n)
# and anything at all that begins in Column 1, so
# is probably a section header.
done = 1;
} else {
if ($0 ~ progname"-") { # Fix old cat pages
sub(progname"-", progname" - ");
}
if ($0 ~ /[^ \\]-$/) {
sub(/-$/, ""); # Handle Hyphenations
nextjoin = 1;
} else if ($0 ~ /\\c$/) {
sub(/\\c$/, ""); # Handle Continuations
nextjoin = 1;
} else
nextjoin = 0;
sub(/^.[IB] /, ""); # Kill bold and italics
sub(/^.BI /, ""); #
sub(/^.SM /, ""); # Kill small
sub(/^.Nm /, ""); # Kill bold
sub(/^.Tn /, ""); # Kill normal
sub(/^.Li /, ""); # Kill .Li
sub(/^.Dq /, ""); # Kill .Dq
sub(/^.Nd */, "- "); # Convert .Nd to dash
sub(/\\\".*/, ""); # Trim pending comments
sub(/ *$/, ""); # Trim pending spaces
sub(/^\.$/, ""); # Kill blank comments
sub(/^'.*/, ""); # Kill comment/troff lines
sub(/^.in .*/, ""); # Kill various macros
sub(/^.ti .*/, "");
sub(/^.ta .*/, "");
sub(/^.Vb .*/, "");
sub(/^.[PLTH]P$/, ""); # .PP/.LP/.TP/.HP
sub(/^.Pp$/, "");
sub(/^.[iI]X .*$/, "");
sub(/^.nolinks$/, "");
sub(/^.B$/, "");
sub(/^.nf$/, "");
if (($1 ~ /^\.../ || $1 == "") &&
(entire_line ~ / - / || entire_line ~ / \\- /)) {
# Assume that this ends the description of one line
# Sometimes there are several descriptions in one page,
# as in outb(2).
handle_entire_line();
entire_line = "";
thisjoin = 1;
} else {
if (thisjoin) {
entire_line = entire_line $0;
} else {
entire_line = entire_line " " $0;
}
thisjoin = nextjoin;
}
}
}
}
handle_entire_line();
closeline();
}
function handle_entire_line() {
x = entire_line; # Keep it short
gsub(/\015/, "", x); # Kill DOS remains
gsub(/ /, " ", x); # Translate tabs to spaces
gsub(/ +/, " ", x); # Collapse spaces
gsub(/ *, */, ", ", x); # Fix comma spacings
sub(/^ /, "", x); # Kill initial spaces
sub(/ $/, "", x); # Kill trailing spaces
sub(/__+/, "_", x); # Collapse underscores
gsub(/\\f\(../, "", x); # Kill font changes
gsub(/\\f[PRIB0123]/, "", x); # Kill font changes
gsub(/\\s[-+0-9]*/, "", x); # Kill size changes
gsub(/\\&/, "", x); # Kill \&
gsub(/\\\|/, "", x); # Kill \|
gsub(/\\\((ru|ul)/, "_", x); # Translate
gsub(/\\\((mi|hy|em)/, "-", x); # Translate
gsub(/\\\*\(../, "", x); # Kill troff strings
gsub(/\\/, "", x); # Kill all backslashes
gsub(/"/, "", x); # Kill quotes (from .Nd "foo bar")
sub(/<h1 align=center>/, "", x);# Yuk! HTML cruft
gsub(/\000.*/, "X", x); # Binary cruft in LAPACK pages
gsub(/ +/, " ", x); # Collapse spaces (again)
sub(/^ /, "", x); # Kill initial spaces (again)
sub(/ $/, "", x); # Kill trailing spaces (again)
sub(/\.$/, "", x); # Kill trailing period
if (!match(x, / - /))
return;
after_dash = substr(x, RSTART);
head = substr(x, 1, RSTART-1) ", ";
while (match(head, /, /)) {
prog = substr(head, 1, RSTART-1);
head = substr(head, RSTART+2);
if (prog != progname)
prog = prog " [" progname "]";
printf "%-*s (%s) %s\n", 20, prog, actual_section, after_dash;
}
}
{ # Main action - process each filename read in.
filename = $0;
do_one();
}
pages=man section=1 verbose= curdir=/usr/share/man/man1
awk: line 74: syntax error at or near ||
awk: line 75: extra ')'
awk: line 78: syntax error at or near else
awk: line 81: syntax error at or near }
awk: line 151: syntax error at or near }
+ cd ..
+ [ -d man2 ]
+ cd man2
+ section=2
+ curdir=/usr/share/man/man2
+ export section verbose curdir
+ find /usr/share/man/man2/. -name * -type f -size +0 -ctime 0 -print
+ /bin/awk
function readline() {
if (use_zcat || use_bzcat) {
result = (pipe_cmd | getline);
if (result < 0) {
print "Pipe error: " pipe_cmd " " ERRNO > "/dev/stderr";
}
} else {
result = (getline < filename);
if (result < 0) {
print "Read file error: " filename " " ERRNO > "/dev/stderr";
}
}
return result;
}
function closeline() {
if (use_zcat || use_bzcat) {
return close(pipe_cmd);
} else {
return close(filename);
}
}
function do_one() {
insh = 0; thisjoin = 1; done = 0;
entire_line = "";
if (verbose) {
print "adding " filename > "/dev/stderr"
}
use_zcat = match(filename,"\\.Z$") ||
match(filename,"\\.z$") || match(filename,"\\.gz$");
if (!use_zcat)
use_bzcat = match(filename,"\\.bz2");
if (use_zcat || use_bzcat) {
filename_no_gz = substr(filename, 0, RSTART - 1);
} else {
filename_no_gz = filename;
}
match(filename_no_gz, "/[^/]+$");
progname = substr(filename, RSTART + 1, RLENGTH - 1);
if (match(progname, "\\." section "[A-Za-z]+")) {
actual_section = substr(progname, RSTART + 1, RLENGTH - 1);
} else {
actual_section = section;
}
sub(/\..*/, "", progname);
if (use_zcat || use_bzcat) {
if (use_zcat) {
pipe_cmd = "zcat \"" filename "\"";
} else {
pipe_cmd = "bzcat \"" filename "\"";
}
# try to avoid suspicious stuff
if (filename ~ /[;&|`$(]/) {
print "ignored strange file name " filename " in " curdir > "/dev/stderr";
return;
}
}
while (!done && readline() > 0) {
gsub(/.\b/, "");
if (($1 ~ /^\.[Ss][Hh]/ &&
($2 ~ /[Nn][Aa][Mm][Ee]/ ||
$2 ~ /^JMÉNO/ || $2 ~ /^NAVN/ || $2 ~ /^NUME/ ||
$2 ~ /^BEZEICHNUNG/ || $2 ~ /^NOMBRE/ ||
$2 ~ /^NIMI/ || $2 ~ /^NOM/ || $2 ~ /^IME/ ||
$2 ~ /^N[ÉE]V/ || $2 ~ /^NAMA/ || $2 ~ /^̾Á°/ ||
$2 ~ /^̾¾Î/ || $2 ~ /^À̸§/ || $2 ~ /^NAZWA/ ||
$2 ~ /^îáú÷áîéå/ || $2 ~ /^Ãû³Æ/ || $2 ~ /^¦WºÙ/ ||
$2 ~ /^NOME/ || $2 ~ /^NAAM/) || $2 ~ /^ÈÌÅ/)) ||
(pages == "cat" && $1 ~ /^NAME/)) {
if (!insh) {
insh = 1;
} else {
done = 1;
}
} else if (insh) {
if ($1 ~ /^\.[Ss][HhYS]/ ||
(pages == "cat" &&
($1 ~ /^S[yYeE]/ || $1 ~ /^DESCRIPTION/ ||
$1 ~ /^COMMAND/ || $1 ~ /^OVERVIEW/ ||
$1 ~ /^STRUCTURES/ || $1 ~ /^INTRODUCTION/ ||
$0 ~ /^[^ ]/))) {
# end insh for Synopsis, Syntax, but also for
# DESCRIPTION (e.g., XFree86.1x),
# COMMAND (e.g., xspread.1)
# OVERVIEW (e.g., TclCommandWriting.3)
# STRUCTURES (e.g., XEvent.3x)
# INTRODUCTION (e.g., TclX.n)
# and anything at all that begins in Column 1, so
# is probably a section header.
done = 1;
} else {
if ($0 ~ progname"-") { # Fix old cat pages
sub(progname"-", progname" - ");
}
if ($0 ~ /[^ \\]-$/) {
sub(/-$/, ""); # Handle Hyphenations
nextjoin = 1;
} else if ($0 ~ /\\c$/) {
sub(/\\c$/, ""); # Handle Continuations
nextjoin = 1;
} else
nextjoin = 0;
sub(/^.[IB] /, ""); # Kill bold and italics
sub(/^.BI /, ""); #
sub(/^.SM /, ""); # Kill small
sub(/^.Nm /, ""); # Kill bold
sub(/^.Tn /, ""); # Kill normal
sub(/^.Li /, ""); # Kill .Li
sub(/^.Dq /, ""); # Kill .Dq
sub(/^.Nd */, "- "); # Convert .Nd to dash
sub(/\\\".*/, ""); # Trim pending comments
sub(/ *$/, ""); # Trim pending spaces
sub(/^\.$/, ""); # Kill blank comments
sub(/^'.*/, ""); # Kill comment/troff lines
sub(/^.in .*/, ""); # Kill various macros
sub(/^.ti .*/, "");
sub(/^.ta .*/, "");
sub(/^.Vb .*/, "");
sub(/^.[PLTH]P$/, ""); # .PP/.LP/.TP/.HP
sub(/^.Pp$/, "");
sub(/^.[iI]X .*$/, "");
sub(/^.nolinks$/, "");
sub(/^.B$/, "");
sub(/^.nf$/, "");
if (($1 ~ /^\.../ || $1 == "") &&
(entire_line ~ / - / || entire_line ~ / \\- /)) {
# Assume that this ends the description of one line
# Sometimes there are several descriptions in one page,
# as in outb(2).
handle_entire_line();
entire_line = "";
thisjoin = 1;
} else {
if (thisjoin) {
entire_line = entire_line $0;
} else {
entire_line = entire_line " " $0;
}
thisjoin = nextjoin;
}
}
}
}
handle_entire_line();
closeline();
}
function handle_entire_line() {
x = entire_line; # Keep it short
gsub(/\015/, "", x); # Kill DOS remains
gsub(/ /, " ", x); # Translate tabs to spaces
gsub(/ +/, " ", x); # Collapse spaces
gsub(/ *, */, ", ", x); # Fix comma spacings
sub(/^ /, "", x); # Kill initial spaces
sub(/ $/, "", x); # Kill trailing spaces
sub(/__+/, "_", x); # Collapse underscores
gsub(/\\f\(../, "", x); # Kill font changes
gsub(/\\f[PRIB0123]/, "", x); # Kill font changes
gsub(/\\s[-+0-9]*/, "", x); # Kill size changes
gsub(/\\&/, "", x); # Kill \&
gsub(/\\\|/, "", x); # Kill \|
gsub(/\\\((ru|ul)/, "_", x); # Translate
gsub(/\\\((mi|hy|em)/, "-", x); # Translate
gsub(/\\\*\(../, "", x); # Kill troff strings
gsub(/\\/, "", x); # Kill all backslashes
gsub(/"/, "", x); # Kill quotes (from .Nd "foo bar")
sub(/<h1 align=center>/, "", x);# Yuk! HTML cruft
gsub(/\000.*/, "X", x); # Binary cruft in LAPACK pages
gsub(/ +/, " ", x); # Collapse spaces (again)
sub(/^ /, "", x); # Kill initial spaces (again)
sub(/ $/, "", x); # Kill trailing spaces (again)
sub(/\.$/, "", x); # Kill trailing period
if (!match(x, / - /))
return;
after_dash = substr(x, RSTART);
head = substr(x, 1, RSTART-1) ", ";
while (match(head, /, /)) {
prog = substr(head, 1, RSTART-1);
head = substr(head, RSTART+2);
if (prog != progname)
prog = prog " [" progname "]";
printf "%-*s (%s) %s\n", 20, prog, actual_section, after_dash;
}
}
{ # Main action - process each filename read in.
filename = $0;
do_one();
}
pages=man section=2 verbose= curdir=/usr/share/man/man2
awk: line 74: syntax error at or near ||
awk: line 75: extra ')'
awk: line 78: syntax error at or near else
awk: line 81: syntax error at or near }
awk: line 151: syntax error at or near }
+ cd ..
+ [ -d man3 ]
+ cd man3
+ section=3
+ curdir=/usr/share/man/man3
+ export section verbose curdir
+ find /usr/share/man/man3/. -name * -type f -size +0 -ctime 0 -print
+ /bin/awk
function readline() {
if (use_zcat || use_bzcat) {
result = (pipe_cmd | getline);
if (result < 0) {
print "Pipe error: " pipe_cmd " " ERRNO > "/dev/stderr";
}
} else {
result = (getline < filename);
if (result < 0) {
print "Read file error: " filename " " ERRNO > "/dev/stderr";
}
}
return result;
}
function closeline() {
if (use_zcat || use_bzcat) {
return close(pipe_cmd);
} else {
return close(filename);
}
}
function do_one() {
insh = 0; thisjoin = 1; done = 0;
entire_line = "";
if (verbose) {
print "adding " filename > "/dev/stderr"
}
use_zcat = match(filename,"\\.Z$") ||
match(filename,"\\.z$") || match(filename,"\\.gz$");
if (!use_zcat)
use_bzcat = match(filename,"\\.bz2");
if (use_zcat || use_bzcat) {
filename_no_gz = substr(filename, 0, RSTART - 1);
} else {
filename_no_gz = filename;
}
match(filename_no_gz, "/[^/]+$");
progname = substr(filename, RSTART + 1, RLENGTH - 1);
if (match(progname, "\\." section "[A-Za-z]+")) {
actual_section = substr(progname, RSTART + 1, RLENGTH - 1);
} else {
actual_section = section;
}
sub(/\..*/, "", progname);
if (use_zcat || use_bzcat) {
if (use_zcat) {
pipe_cmd = "zcat \"" filename "\"";
} else {
pipe_cmd = "bzcat \"" filename "\"";
}
# try to avoid suspicious stuff
if (filename ~ /[;&|`$(]/) {
print "ignored strange file name " filename " in " curdir > "/dev/stderr";
return;
}
}
while (!done && readline() > 0) {
gsub(/.\b/, "");
if (($1 ~ /^\.[Ss][Hh]/ &&
($2 ~ /[Nn][Aa][Mm][Ee]/ ||
$2 ~ /^JMÉNO/ || $2 ~ /^NAVN/ || $2 ~ /^NUME/ ||
$2 ~ /^BEZEICHNUNG/ || $2 ~ /^NOMBRE/ ||
$2 ~ /^NIMI/ || $2 ~ /^NOM/ || $2 ~ /^IME/ ||
$2 ~ /^N[ÉE]V/ || $2 ~ /^NAMA/ || $2 ~ /^̾Á°/ ||
$2 ~ /^̾¾Î/ || $2 ~ /^À̸§/ || $2 ~ /^NAZWA/ ||
$2 ~ /^îáú÷áîéå/ || $2 ~ /^Ãû³Æ/ || $2 ~ /^¦WºÙ/ ||
$2 ~ /^NOME/ || $2 ~ /^NAAM/) || $2 ~ /^ÈÌÅ/)) ||
(pages == "cat" && $1 ~ /^NAME/)) {
if (!insh) {
insh = 1;
} else {
done = 1;
}
} else if (insh) {
if ($1 ~ /^\.[Ss][HhYS]/ ||
(pages == "cat" &&
($1 ~ /^S[yYeE]/ || $1 ~ /^DESCRIPTION/ ||
$1 ~ /^COMMAND/ || $1 ~ /^OVERVIEW/ ||
$1 ~ /^STRUCTURES/ || $1 ~ /^INTRODUCTION/ ||
$0 ~ /^[^ ]/))) {
# end insh for Synopsis, Syntax, but also for
# DESCRIPTION (e.g., XFree86.1x),
# COMMAND (e.g., xspread.1)
# OVERVIEW (e.g., TclCommandWriting.3)
# STRUCTURES (e.g., XEvent.3x)
# INTRODUCTION (e.g., TclX.n)
# and anything at all that begins in Column 1, so
# is probably a section header.
done = 1;
} else {
if ($0 ~ progname"-") { # Fix old cat pages
sub(progname"-", progname" - ");
}
if ($0 ~ /[^ \\]-$/) {
sub(/-$/, ""); # Handle Hyphenations
nextjoin = 1;
} else if ($0 ~ /\\c$/) {
sub(/\\c$/, ""); # Handle Continuations
nextjoin = 1;
} else
nextjoin = 0;
sub(/^.[IB] /, ""); # Kill bold and italics
sub(/^.BI /, ""); #
sub(/^.SM /, ""); # Kill small
sub(/^.Nm /, ""); # Kill bold
sub(/^.Tn /, ""); # Kill normal
sub(/^.Li /, ""); # Kill .Li
sub(/^.Dq /, ""); # Kill .Dq
sub(/^.Nd */, "- "); # Convert .Nd to dash
sub(/\\\".*/, ""); # Trim pending comments
sub(/ *$/, ""); # Trim pending spaces
sub(/^\.$/, ""); # Kill blank comments
sub(/^'.*/, ""); # Kill comment/troff lines
sub(/^.in .*/, ""); # Kill various macros
sub(/^.ti .*/, "");
sub(/^.ta .*/, "");
sub(/^.Vb .*/, "");
sub(/^.[PLTH]P$/, ""); # .PP/.LP/.TP/.HP
sub(/^.Pp$/, "");
sub(/^.[iI]X .*$/, "");
sub(/^.nolinks$/, "");
sub(/^.B$/, "");
sub(/^.nf$/, "");
if (($1 ~ /^\.../ || $1 == "") &&
(entire_line ~ / - / || entire_line ~ / \\- /)) {
# Assume that this ends the description of one line
# Sometimes there are several descriptions in one page,
# as in outb(2).
handle_entire_line();
entire_line = "";
thisjoin = 1;
} else {
if (thisjoin) {
entire_line = entire_line $0;
} else {
entire_line = entire_line " " $0;
}
thisjoin = nextjoin;
}
}
}
}
handle_entire_line();
closeline();
}
function handle_entire_line() {
x = entire_line; # Keep it short
gsub(/\015/, "", x); # Kill DOS remains
gsub(/ /, " ", x); # Translate tabs to spaces
gsub(/ +/, " ", x); # Collapse spaces
gsub(/ *, */, ", ", x); # Fix comma spacings
sub(/^ /, "", x); # Kill initial spaces
sub(/ $/, "", x); # Kill trailing spaces
sub(/__+/, "_", x); # Collapse underscores
gsub(/\\f\(../, "", x); # Kill font changes
gsub(/\\f[PRIB0123]/, "", x); # Kill font changes
gsub(/\\s[-+0-9]*/, "", x); # Kill size changes
gsub(/\\&/, "", x); # Kill \&
gsub(/\\\|/, "", x); # Kill \|
gsub(/\\\((ru|ul)/, "_", x); # Translate
gsub(/\\\((mi|hy|em)/, "-", x); # Translate
gsub(/\\\*\(../, "", x); # Kill troff strings
gsub(/\\/, "", x); # Kill all backslashes
gsub(/"/, "", x); # Kill quotes (from .Nd "foo bar")
sub(/<h1 align=center>/, "", x);# Yuk! HTML cruft
gsub(/\000.*/, "X", x); # Binary cruft in LAPACK pages
gsub(/ +/, " ", x); # Collapse spaces (again)
sub(/^ /, "", x); # Kill initial spaces (again)
sub(/ $/, "", x); # Kill trailing spaces (again)
sub(/\.$/, "", x); # Kill trailing period
if (!match(x, / - /))
return;
after_dash = substr(x, RSTART);
head = substr(x, 1, RSTART-1) ", ";
while (match(head, /, /)) {
prog = substr(head, 1, RSTART-1);
head = substr(head, RSTART+2);
if (prog != progname)
prog = prog " [" progname "]";
printf "%-*s (%s) %s\n", 20, prog, actual_section, after_dash;
}
}
{ # Main action - process each filename read in.
filename = $0;
do_one();
}
pages=man section=3 verbose= curdir=/usr/share/man/man3
awk: line 74: syntax error at or near ||
awk: line 75: extra ')'
awk: line 78: syntax error at or near else
awk: line 81: syntax error at or near }
awk: line 151: syntax error at or near }
+ cd ..
+ [ -d man4 ]
+ cd man4
+ section=4
+ curdir=/usr/share/man/man4
+ export section verbose curdir
+ find /usr/share/man/man4/. -name * -type f -size +0 -ctime 0 -print
+ /bin/awk
function readline() {
if (use_zcat || use_bzcat) {
result = (pipe_cmd | getline);
if (result < 0) {
print "Pipe error: " pipe_cmd " " ERRNO > "/dev/stderr";
}
} else {
result = (getline < filename);
if (result < 0) {
print "Read file error: " filename " " ERRNO > "/dev/stderr";
}
}
return result;
}
function closeline() {
if (use_zcat || use_bzcat) {
return close(pipe_cmd);
} else {
return close(filename);
}
}
function do_one() {
insh = 0; thisjoin = 1; done = 0;
entire_line = "";
if (verbose) {
print "adding " filename > "/dev/stderr"
}
use_zcat = match(filename,"\\.Z$") ||
match(filename,"\\.z$") || match(filename,"\\.gz$");
if (!use_zcat)
use_bzcat = match(filename,"\\.bz2");
if (use_zcat || use_bzcat) {
filename_no_gz = substr(filename, 0, RSTART - 1);
} else {
filename_no_gz = filename;
}
match(filename_no_gz, "/[^/]+$");
progname = substr(filename, RSTART + 1, RLENGTH - 1);
if (match(progname, "\\." section "[A-Za-z]+")) {
actual_section = substr(progname, RSTART + 1, RLENGTH - 1);
} else {
actual_section = section;
}
sub(/\..*/, "", progname);
if (use_zcat || use_bzcat) {
if (use_zcat) {
pipe_cmd = "zcat \"" filename "\"";
} else {
pipe_cmd = "bzcat \"" filename "\"";
}
# try to avoid suspicious stuff
if (filename ~ /[;&|`$(]/) {
print "ignored strange file name " filename " in " curdir > "/dev/stderr";
return;
}
}
while (!done && readline() > 0) {
gsub(/.\b/, "");
if (($1 ~ /^\.[Ss][Hh]/ &&
($2 ~ /[Nn][Aa][Mm][Ee]/ ||
$2 ~ /^JMÉNO/ || $2 ~ /^NAVN/ || $2 ~ /^NUME/ ||
$2 ~ /^BEZEICHNUNG/ || $2 ~ /^NOMBRE/ ||
$2 ~ /^NIMI/ || $2 ~ /^NOM/ || $2 ~ /^IME/ ||
$2 ~ /^N[ÉE]V/ || $2 ~ /^NAMA/ || $2 ~ /^̾Á°/ ||
$2 ~ /^̾¾Î/ || $2 ~ /^À̸§/ || $2 ~ /^NAZWA/ ||
$2 ~ /^îáú÷áîéå/ || $2 ~ /^Ãû³Æ/ || $2 ~ /^¦WºÙ/ ||
$2 ~ /^NOME/ || $2 ~ /^NAAM/) || $2 ~ /^ÈÌÅ/)) ||
(pages == "cat" && $1 ~ /^NAME/)) {
if (!insh) {
insh = 1;
} else {
done = 1;
}
} else if (insh) {
if ($1 ~ /^\.[Ss][HhYS]/ ||
(pages == "cat" &&
($1 ~ /^S[yYeE]/ || $1 ~ /^DESCRIPTION/ ||
$1 ~ /^COMMAND/ || $1 ~ /^OVERVIEW/ ||
$1 ~ /^STRUCTURES/ || $1 ~ /^INTRODUCTION/ ||
$0 ~ /^[^ ]/))) {
# end insh for Synopsis, Syntax, but also for
# DESCRIPTION (e.g., XFree86.1x),
# COMMAND (e.g., xspread.1)
# OVERVIEW (e.g., TclCommandWriting.3)
# STRUCTURES (e.g., XEvent.3x)
# INTRODUCTION (e.g., TclX.n)
# and anything at all that begins in Column 1, so
# is probably a section header.
done = 1;
} else {
if ($0 ~ progname"-") { # Fix old cat pages
sub(progname"-", progname" - ");
}
if ($0 ~ /[^ \\]-$/) {
sub(/-$/, ""); # Handle Hyphenations
nextjoin = 1;
} else if ($0 ~ /\\c$/) {
sub(/\\c$/, ""); # Handle Continuations
nextjoin = 1;
} else
nextjoin = 0;
sub(/^.[IB] /, ""); # Kill bold and italics
sub(/^.BI /, ""); #
sub(/^.SM /, ""); # Kill small
sub(/^.Nm /, ""); # Kill bold
sub(/^.Tn /, ""); # Kill normal
sub(/^.Li /, ""); # Kill .Li
sub(/^.Dq /, ""); # Kill .Dq
sub(/^.Nd */, "- "); # Convert .Nd to dash
sub(/\\\".*/, ""); # Trim pending comments
sub(/ *$/, ""); # Trim pending spaces
sub(/^\.$/, ""); # Kill blank comments
sub(/^'.*/, ""); # Kill comment/troff lines
sub(/^.in .*/, ""); # Kill various macros
sub(/^.ti .*/, "");
sub(/^.ta .*/, "");
sub(/^.Vb .*/, "");
sub(/^.[PLTH]P$/, ""); # .PP/.LP/.TP/.HP
sub(/^.Pp$/, "");
sub(/^.[iI]X .*$/, "");
sub(/^.nolinks$/, "");
sub(/^.B$/, "");
sub(/^.nf$/, "");
if (($1 ~ /^\.../ || $1 == "") &&
(entire_line ~ / - / || entire_line ~ / \\- /)) {
# Assume that this ends the description of one line
# Sometimes there are several descriptions in one page,
# as in outb(2).
handle_entire_line();
entire_line = "";
thisjoin = 1;
} else {
if (thisjoin) {
entire_line = entire_line $0;
} else {
entire_line = entire_line " " $0;
}
thisjoin = nextjoin;
}
}
}
}
handle_entire_line();
closeline();
}
function handle_entire_line() {
x = entire_line; # Keep it short
gsub(/\015/, "", x); # Kill DOS remains
gsub(/ /, " ", x); # Translate tabs to spaces
gsub(/ +/, " ", x); # Collapse spaces
gsub(/ *, */, ", ", x); # Fix comma spacings
sub(/^ /, "", x); # Kill initial spaces
sub(/ $/, "", x); # Kill trailing spaces
sub(/__+/, "_", x); # Collapse underscores
gsub(/\\f\(../, "", x); # Kill font changes
gsub(/\\f[PRIB0123]/, "", x); # Kill font changes
gsub(/\\s[-+0-9]*/, "", x); # Kill size changes
gsub(/\\&/, "", x); # Kill \&
gsub(/\\\|/, "", x); # Kill \|
gsub(/\\\((ru|ul)/, "_", x); # Translate
gsub(/\\\((mi|hy|em)/, "-", x); # Translate
gsub(/\\\*\(../, "", x); # Kill troff strings
gsub(/\\/, "", x); # Kill all backslashes
gsub(/"/, "", x); # Kill quotes (from .Nd "foo bar")
sub(/<h1 align=center>/, "", x);# Yuk! HTML cruft
gsub(/\000.*/, "X", x); # Binary cruft in LAPACK pages
gsub(/ +/, " ", x); # Collapse spaces (again)
sub(/^ /, "", x); # Kill initial spaces (again)
sub(/ $/, "", x); # Kill trailing spaces (again)
sub(/\.$/, "", x); # Kill trailing period
if (!match(x, / - /))
return;
after_dash = substr(x, RSTART);
head = substr(x, 1, RSTART-1) ", ";
while (match(head, /, /)) {
prog = substr(head, 1, RSTART-1);
head = substr(head, RSTART+2);
if (prog != progname)
prog = prog " [" progname "]";
printf "%-*s (%s) %s\n", 20, prog, actual_section, after_dash;
}
}
{ # Main action - process each filename read in.
filename = $0;
do_one();
}
pages=man section=4 verbose= curdir=/usr/share/man/man4
awk: line 74: syntax error at or near ||
awk: line 75: extra ')'
awk: line 78: syntax error at or near else
awk: line 81: syntax error at or near }
awk: line 151: syntax error at or near }
+ cd ..
+ [ -d man5 ]
+ cd man5
+ section=5
+ curdir=/usr/share/man/man5
+ export section verbose curdir
+ find /usr/share/man/man5/. -name * -type f -size +0 -ctime 0 -print
+ /bin/awk
function readline() {
if (use_zcat || use_bzcat) {
result = (pipe_cmd | getline);
if (result < 0) {
print "Pipe error: " pipe_cmd " " ERRNO > "/dev/stderr";
}
} else {
result = (getline < filename);
if (result < 0) {
print "Read file error: " filename " " ERRNO > "/dev/stderr";
}
}
return result;
}
function closeline() {
if (use_zcat || use_bzcat) {
return close(pipe_cmd);
} else {
return close(filename);
}
}
function do_one() {
insh = 0; thisjoin = 1; done = 0;
entire_line = "";
if (verbose) {
print "adding " filename > "/dev/stderr"
}
use_zcat = match(filename,"\\.Z$") ||
match(filename,"\\.z$") || match(filename,"\\.gz$");
if (!use_zcat)
use_bzcat = match(filename,"\\.bz2");
if (use_zcat || use_bzcat) {
filename_no_gz = substr(filename, 0, RSTART - 1);
} else {
filename_no_gz = filename;
}
match(filename_no_gz, "/[^/]+$");
progname = substr(filename, RSTART + 1, RLENGTH - 1);
if (match(progname, "\\." section "[A-Za-z]+")) {
actual_section = substr(progname, RSTART + 1, RLENGTH - 1);
} else {
actual_section = section;
}
sub(/\..*/, "", progname);
if (use_zcat || use_bzcat) {
if (use_zcat) {
pipe_cmd = "zcat \"" filename "\"";
} else {
pipe_cmd = "bzcat \"" filename "\"";
}
# try to avoid suspicious stuff
if (filename ~ /[;&|`$(]/) {
print "ignored strange file name " filename " in " curdir > "/dev/stderr";
return;
}
}
while (!done && readline() > 0) {
gsub(/.\b/, "");
if (($1 ~ /^\.[Ss][Hh]/ &&
($2 ~ /[Nn][Aa][Mm][Ee]/ ||
$2 ~ /^JMÉNO/ || $2 ~ /^NAVN/ || $2 ~ /^NUME/ ||
$2 ~ /^BEZEICHNUNG/ || $2 ~ /^NOMBRE/ ||
$2 ~ /^NIMI/ || $2 ~ /^NOM/ || $2 ~ /^IME/ ||
$2 ~ /^N[ÉE]V/ || $2 ~ /^NAMA/ || $2 ~ /^̾Á°/ ||
$2 ~ /^̾¾Î/ || $2 ~ /^À̸§/ || $2 ~ /^NAZWA/ ||
$2 ~ /^îáú÷áîéå/ || $2 ~ /^Ãû³Æ/ || $2 ~ /^¦WºÙ/ ||
$2 ~ /^NOME/ || $2 ~ /^NAAM/) || $2 ~ /^ÈÌÅ/)) ||
(pages == "cat" && $1 ~ /^NAME/)) {
if (!insh) {
insh = 1;
} else {
done = 1;
}
} else if (insh) {
if ($1 ~ /^\.[Ss][HhYS]/ ||
(pages == "cat" &&
($1 ~ /^S[yYeE]/ || $1 ~ /^DESCRIPTION/ ||
$1 ~ /^COMMAND/ || $1 ~ /^OVERVIEW/ ||
$1 ~ /^STRUCTURES/ || $1 ~ /^INTRODUCTION/ ||
$0 ~ /^[^ ]/))) {
# end insh for Synopsis, Syntax, but also for
# DESCRIPTION (e.g., XFree86.1x),
# COMMAND (e.g., xspread.1)
# OVERVIEW (e.g., TclCommandWriting.3)
# STRUCTURES (e.g., XEvent.3x)
# INTRODUCTION (e.g., TclX.n)
# and anything at all that begins in Column 1, so
# is probably a section header.
done = 1;
} else {
if ($0 ~ progname"-") { # Fix old cat pages
sub(progname"-", progname" - ");
}
if ($0 ~ /[^ \\]-$/) {
sub(/-$/, ""); # Handle Hyphenations
nextjoin = 1;
} else if ($0 ~ /\\c$/) {
sub(/\\c$/, ""); # Handle Continuations
nextjoin = 1;
} else
nextjoin = 0;
sub(/^.[IB] /, ""); # Kill bold and italics
sub(/^.BI /, ""); #
sub(/^.SM /, ""); # Kill small
sub(/^.Nm /, ""); # Kill bold
sub(/^.Tn /, ""); # Kill normal
sub(/^.Li /, ""); # Kill .Li
sub(/^.Dq /, ""); # Kill .Dq
sub(/^.Nd */, "- "); # Convert .Nd to dash
sub(/\\\".*/, ""); # Trim pending comments
sub(/ *$/, ""); # Trim pending spaces
sub(/^\.$/, ""); # Kill blank comments
sub(/^'.*/, ""); # Kill comment/troff lines
sub(/^.in .*/, ""); # Kill various macros
sub(/^.ti .*/, "");
sub(/^.ta .*/, "");
sub(/^.Vb .*/, "");
sub(/^.[PLTH]P$/, ""); # .PP/.LP/.TP/.HP
sub(/^.Pp$/, "");
sub(/^.[iI]X .*$/, "");
sub(/^.nolinks$/, "");
sub(/^.B$/, "");
sub(/^.nf$/, "");
if (($1 ~ /^\.../ || $1 == "") &&
(entire_line ~ / - / || entire_line ~ / \\- /)) {
# Assume that this ends the description of one line
# Sometimes there are several descriptions in one page,
# as in outb(2).
handle_entire_line();
entire_line = "";
thisjoin = 1;
} else {
if (thisjoin) {
entire_line = entire_line $0;
} else {
entire_line = entire_line " " $0;
}
thisjoin = nextjoin;
}
}
}
}
handle_entire_line();
closeline();
}
function handle_entire_line() {
x = entire_line; # Keep it short
gsub(/\015/, "", x); # Kill DOS remains
gsub(/ /, " ", x); # Translate tabs to spaces
gsub(/ +/, " ", x); # Collapse spaces
gsub(/ *, */, ", ", x); # Fix comma spacings
sub(/^ /, "", x); # Kill initial spaces
sub(/ $/, "", x); # Kill trailing spaces
sub(/__+/, "_", x); # Collapse underscores
gsub(/\\f\(../, "", x); # Kill font changes
gsub(/\\f[PRIB0123]/, "", x); # Kill font changes
gsub(/\\s[-+0-9]*/, "", x); # Kill size changes
gsub(/\\&/, "", x); # Kill \&
gsub(/\\\|/, "", x); # Kill \|
gsub(/\\\((ru|ul)/, "_", x); # Translate
gsub(/\\\((mi|hy|em)/, "-", x); # Translate
gsub(/\\\*\(../, "", x); # Kill troff strings
gsub(/\\/, "", x); # Kill all backslashes
gsub(/"/, "", x); # Kill quotes (from .Nd "foo bar")
sub(/<h1 align=center>/, "", x);# Yuk! HTML cruft
gsub(/\000.*/, "X", x); # Binary cruft in LAPACK pages
gsub(/ +/, " ", x); # Collapse spaces (again)
sub(/^ /, "", x); # Kill initial spaces (again)
sub(/ $/, "", x); # Kill trailing spaces (again)
sub(/\.$/, "", x); # Kill trailing period
if (!match(x, / - /))
return;
after_dash = substr(x, RSTART);
head = substr(x, 1, RSTART-1) ", ";
while (match(head, /, /)) {
prog = substr(head, 1, RSTART-1);
head = substr(head, RSTART+2);
if (prog != progname)
prog = prog " [" progname "]";
printf "%-*s (%s) %s\n", 20, prog, actual_section, after_dash;
}
}
{ # Main action - process each filename read in.
filename = $0;
do_one();
}
pages=man section=5 verbose= curdir=/usr/share/man/man5
awk: line 74: syntax error at or near ||
awk: line 75: extra ')'
awk: line 78: syntax error at or near else
awk: line 81: syntax error at or near }
awk: line 151: syntax error at or near }
+ cd ..
+ [ -d man6 ]
+ cd man6
+ section=6
+ curdir=/usr/share/man/man6
+ export section verbose curdir
+ find /usr/share/man/man6/. -name * -type f -size +0 -ctime 0 -print
+ /bin/awk
function readline() {
if (use_zcat || use_bzcat) {
result = (pipe_cmd | getline);
if (result < 0) {
print "Pipe error: " pipe_cmd " " ERRNO > "/dev/stderr";
}
} else {
result = (getline < filename);
if (result < 0) {
print "Read file error: " filename " " ERRNO > "/dev/stderr";
}
}
return result;
}
function closeline() {
if (use_zcat || use_bzcat) {
return close(pipe_cmd);
} else {
return close(filename);
}
}
function do_one() {
insh = 0; thisjoin = 1; done = 0;
entire_line = "";
if (verbose) {
print "adding " filename > "/dev/stderr"
}
use_zcat = match(filename,"\\.Z$") ||
match(filename,"\\.z$") || match(filename,"\\.gz$");
if (!use_zcat)
use_bzcat = match(filename,"\\.bz2");
if (use_zcat || use_bzcat) {
filename_no_gz = substr(filename, 0, RSTART - 1);
} else {
filename_no_gz = filename;
}
match(filename_no_gz, "/[^/]+$");
progname = substr(filename, RSTART + 1, RLENGTH - 1);
if (match(progname, "\\." section "[A-Za-z]+")) {
actual_section = substr(progname, RSTART + 1, RLENGTH - 1);
} else {
actual_section = section;
}
sub(/\..*/, "", progname);
if (use_zcat || use_bzcat) {
if (use_zcat) {
pipe_cmd = "zcat \"" filename "\"";
} else {
pipe_cmd = "bzcat \"" filename "\"";
}
# try to avoid suspicious stuff
if (filename ~ /[;&|`$(]/) {
print "ignored strange file name " filename " in " curdir > "/dev/stderr";
return;
}
}
while (!done && readline() > 0) {
gsub(/.\b/, "");
if (($1 ~ /^\.[Ss][Hh]/ &&
($2 ~ /[Nn][Aa][Mm][Ee]/ ||
$2 ~ /^JMÉNO/ || $2 ~ /^NAVN/ || $2 ~ /^NUME/ ||
$2 ~ /^BEZEICHNUNG/ || $2 ~ /^NOMBRE/ ||
$2 ~ /^NIMI/ || $2 ~ /^NOM/ || $2 ~ /^IME/ ||
$2 ~ /^N[ÉE]V/ || $2 ~ /^NAMA/ || $2 ~ /^̾Á°/ ||
$2 ~ /^̾¾Î/ || $2 ~ /^À̸§/ || $2 ~ /^NAZWA/ ||
$2 ~ /^îáú÷áîéå/ || $2 ~ /^Ãû³Æ/ || $2 ~ /^¦WºÙ/ ||
$2 ~ /^NOME/ || $2 ~ /^NAAM/) || $2 ~ /^ÈÌÅ/)) ||
(pages == "cat" && $1 ~ /^NAME/)) {
if (!insh) {
insh = 1;
} else {
done = 1;
}
} else if (insh) {
if ($1 ~ /^\.[Ss][HhYS]/ ||
(pages == "cat" &&
($1 ~ /^S[yYeE]/ || $1 ~ /^DESCRIPTION/ ||
$1 ~ /^COMMAND/ || $1 ~ /^OVERVIEW/ ||
$1 ~ /^STRUCTURES/ || $1 ~ /^INTRODUCTION/ ||
$0 ~ /^[^ ]/))) {
# end insh for Synopsis, Syntax, but also for
# DESCRIPTION (e.g., XFree86.1x),
# COMMAND (e.g., xspread.1)
# OVERVIEW (e.g., TclCommandWriting.3)
# STRUCTURES (e.g., XEvent.3x)
# INTRODUCTION (e.g., TclX.n)
# and anything at all that begins in Column 1, so
# is probably a section header.
done = 1;
} else {
if ($0 ~ progname"-") { # Fix old cat pages
sub(progname"-", progname" - ");
}
if ($0 ~ /[^ \\]-$/) {
sub(/-$/, ""); # Handle Hyphenations
nextjoin = 1;
} else if ($0 ~ /\\c$/) {
sub(/\\c$/, ""); # Handle Continuations
nextjoin = 1;
} else
nextjoin = 0;
sub(/^.[IB] /, ""); # Kill bold and italics
sub(/^.BI /, ""); #
sub(/^.SM /, ""); # Kill small
sub(/^.Nm /, ""); # Kill bold
sub(/^.Tn /, ""); # Kill normal
sub(/^.Li /, ""); # Kill .Li
sub(/^.Dq /, ""); # Kill .Dq
sub(/^.Nd */, "- "); # Convert .Nd to dash
sub(/\\\".*/, ""); # Trim pending comments
sub(/ *$/, ""); # Trim pending spaces
sub(/^\.$/, ""); # Kill blank comments
sub(/^'.*/, ""); # Kill comment/troff lines
sub(/^.in .*/, ""); # Kill various macros
sub(/^.ti .*/, "");
sub(/^.ta .*/, "");
sub(/^.Vb .*/, "");
sub(/^.[PLTH]P$/, ""); # .PP/.LP/.TP/.HP
sub(/^.Pp$/, "");
sub(/^.[iI]X .*$/, "");
sub(/^.nolinks$/, "");
sub(/^.B$/, "");
sub(/^.nf$/, "");
if (($1 ~ /^\.../ || $1 == "") &&
(entire_line ~ / - / || entire_line ~ / \\- /)) {
# Assume that this ends the description of one line
# Sometimes there are several descriptions in one page,
# as in outb(2).
handle_entire_line();
entire_line = "";
thisjoin = 1;
} else {
if (thisjoin) {
entire_line = entire_line $0;
} else {
entire_line = entire_line " " $0;
}
thisjoin = nextjoin;
}
}
}
}
handle_entire_line();
closeline();
}
function handle_entire_line() {
x = entire_line; # Keep it short
gsub(/\015/, "", x); # Kill DOS remains
gsub(/ /, " ", x); # Translate tabs to spaces
gsub(/ +/, " ", x); # Collapse spaces
gsub(/ *, */, ", ", x); # Fix comma spacings
sub(/^ /, "", x); # Kill initial spaces
sub(/ $/, "", x); # Kill trailing spaces
sub(/__+/, "_", x); # Collapse underscores
gsub(/\\f\(../, "", x); # Kill font changes
gsub(/\\f[PRIB0123]/, "", x); # Kill font changes
gsub(/\\s[-+0-9]*/, "", x); # Kill size changes
gsub(/\\&/, "", x); # Kill \&
gsub(/\\\|/, "", x); # Kill \|
gsub(/\\\((ru|ul)/, "_", x); # Translate
gsub(/\\\((mi|hy|em)/, "-", x); # Translate
gsub(/\\\*\(../, "", x); # Kill troff strings
gsub(/\\/, "", x); # Kill all backslashes
gsub(/"/, "", x); # Kill quotes (from .Nd "foo bar")
sub(/<h1 align=center>/, "", x);# Yuk! HTML cruft
gsub(/\000.*/, "X", x); # Binary cruft in LAPACK pages
gsub(/ +/, " ", x); # Collapse spaces (again)
sub(/^ /, "", x); # Kill initial spaces (again)
sub(/ $/, "", x); # Kill trailing spaces (again)
sub(/\.$/, "", x); # Kill trailing period
if (!match(x, / - /))
return;
after_dash = substr(x, RSTART);
head = substr(x, 1, RSTART-1) ", ";
while (match(head, /, /)) {
prog = substr(head, 1, RSTART-1);
head = substr(head, RSTART+2);
if (prog != progname)
prog = prog " [" progname "]";
printf "%-*s (%s) %s\n", 20, prog, actual_section, after_dash;
}
}
{ # Main action - process each filename read in.
filename = $0;
do_one();
}
pages=man section=6 verbose= curdir=/usr/share/man/man6
awk: line 74: syntax error at or near ||
awk: line 75: extra ')'
awk: line 78: syntax error at or near else
awk: line 81: syntax error at or near }
awk: line 151: syntax error at or near }
+ cd ..
+ [ -d man7 ]
+ cd man7
+ section=7
+ curdir=/usr/share/man/man7
+ export section verbose curdir
+ find /usr/share/man/man7/. -name * -type f -size +0 -ctime 0 -print
+ /bin/awk
function readline() {
if (use_zcat || use_bzcat) {
result = (pipe_cmd | getline);
if (result < 0) {
print "Pipe error: " pipe_cmd " " ERRNO > "/dev/stderr";
}
} else {
result = (getline < filename);
if (result < 0) {
print "Read file error: " filename " " ERRNO > "/dev/stderr";
}
}
return result;
}
function closeline() {
if (use_zcat || use_bzcat) {
return close(pipe_cmd);
} else {
return close(filename);
}
}
function do_one() {
insh = 0; thisjoin = 1; done = 0;
entire_line = "";
if (verbose) {
print "adding " filename > "/dev/stderr"
}
use_zcat = match(filename,"\\.Z$") ||
match(filename,"\\.z$") || match(filename,"\\.gz$");
if (!use_zcat)
use_bzcat = match(filename,"\\.bz2");
if (use_zcat || use_bzcat) {
filename_no_gz = substr(filename, 0, RSTART - 1);
} else {
filename_no_gz = filename;
}
match(filename_no_gz, "/[^/]+$");
progname = substr(filename, RSTART + 1, RLENGTH - 1);
if (match(progname, "\\." section "[A-Za-z]+")) {
actual_section = substr(progname, RSTART + 1, RLENGTH - 1);
} else {
actual_section = section;
}
sub(/\..*/, "", progname);
if (use_zcat || use_bzcat) {
if (use_zcat) {
pipe_cmd = "zcat \"" filename "\"";
} else {
pipe_cmd = "bzcat \"" filename "\"";
}
# try to avoid suspicious stuff
if (filename ~ /[;&|`$(]/) {
print "ignored strange file name " filename " in " curdir > "/dev/stderr";
return;
}
}
while (!done && readline() > 0) {
gsub(/.\b/, "");
if (($1 ~ /^\.[Ss][Hh]/ &&
($2 ~ /[Nn][Aa][Mm][Ee]/ ||
$2 ~ /^JMÉNO/ || $2 ~ /^NAVN/ || $2 ~ /^NUME/ ||
$2 ~ /^BEZEICHNUNG/ || $2 ~ /^NOMBRE/ ||
$2 ~ /^NIMI/ || $2 ~ /^NOM/ || $2 ~ /^IME/ ||
$2 ~ /^N[ÉE]V/ || $2 ~ /^NAMA/ || $2 ~ /^̾Á°/ ||
$2 ~ /^̾¾Î/ || $2 ~ /^À̸§/ || $2 ~ /^NAZWA/ ||
$2 ~ /^îáú÷áîéå/ || $2 ~ /^Ãû³Æ/ || $2 ~ /^¦WºÙ/ ||
$2 ~ /^NOME/ || $2 ~ /^NAAM/) || $2 ~ /^ÈÌÅ/)) ||
(pages == "cat" && $1 ~ /^NAME/)) {
if (!insh) {
insh = 1;
} else {
done = 1;
}
} else if (insh) {
if ($1 ~ /^\.[Ss][HhYS]/ ||
(pages == "cat" &&
($1 ~ /^S[yYeE]/ || $1 ~ /^DESCRIPTION/ ||
$1 ~ /^COMMAND/ || $1 ~ /^OVERVIEW/ ||
$1 ~ /^STRUCTURES/ || $1 ~ /^INTRODUCTION/ ||
$0 ~ /^[^ ]/))) {
# end insh for Synopsis, Syntax, but also for
# DESCRIPTION (e.g., XFree86.1x),
# COMMAND (e.g., xspread.1)
# OVERVIEW (e.g., TclCommandWriting.3)
# STRUCTURES (e.g., XEvent.3x)
# INTRODUCTION (e.g., TclX.n)
# and anything at all that begins in Column 1, so
# is probably a section header.
done = 1;
} else {
if ($0 ~ progname"-") { # Fix old cat pages
sub(progname"-", progname" - ");
}
if ($0 ~ /[^ \\]-$/) {
sub(/-$/, ""); # Handle Hyphenations
nextjoin = 1;
} else if ($0 ~ /\\c$/) {
sub(/\\c$/, ""); # Handle Continuations
nextjoin = 1;
} else
nextjoin = 0;
sub(/^.[IB] /, ""); # Kill bold and italics
sub(/^.BI /, ""); #
sub(/^.SM /, ""); # Kill small
sub(/^.Nm /, ""); # Kill bold
sub(/^.Tn /, ""); # Kill normal
sub(/^.Li /, ""); # Kill .Li
sub(/^.Dq /, ""); # Kill .Dq
sub(/^.Nd */, "- "); # Convert .Nd to dash
sub(/\\\".*/, ""); # Trim pending comments
sub(/ *$/, ""); # Trim pending spaces
sub(/^\.$/, ""); # Kill blank comments
sub(/^'.*/, ""); # Kill comment/troff lines
sub(/^.in .*/, ""); # Kill various macros
sub(/^.ti .*/, "");
sub(/^.ta .*/, "");
sub(/^.Vb .*/, "");
sub(/^.[PLTH]P$/, ""); # .PP/.LP/.TP/.HP
sub(/^.Pp$/, "");
sub(/^.[iI]X .*$/, "");
sub(/^.nolinks$/, "");
sub(/^.B$/, "");
sub(/^.nf$/, "");
if (($1 ~ /^\.../ || $1 == "") &&
(entire_line ~ / - / || entire_line ~ / \\- /)) {
# Assume that this ends the description of one line
# Sometimes there are several descriptions in one page,
# as in outb(2).
handle_entire_line();
entire_line = "";
thisjoin = 1;
} else {
if (thisjoin) {
entire_line = entire_line $0;
} else {
entire_line = entire_line " " $0;
}
thisjoin = nextjoin;
}
}
}
}
handle_entire_line();
closeline();
}
function handle_entire_line() {
x = entire_line; # Keep it short
gsub(/\015/, "", x); # Kill DOS remains
gsub(/ /, " ", x); # Translate tabs to spaces
gsub(/ +/, " ", x); # Collapse spaces
gsub(/ *, */, ", ", x); # Fix comma spacings
sub(/^ /, "", x); # Kill initial spaces
sub(/ $/, "", x); # Kill trailing spaces
sub(/__+/, "_", x); # Collapse underscores
gsub(/\\f\(../, "", x); # Kill font changes
gsub(/\\f[PRIB0123]/, "", x); # Kill font changes
gsub(/\\s[-+0-9]*/, "", x); # Kill size changes
gsub(/\\&/, "", x); # Kill \&
gsub(/\\\|/, "", x); # Kill \|
gsub(/\\\((ru|ul)/, "_", x); # Translate
gsub(/\\\((mi|hy|em)/, "-", x); # Translate
gsub(/\\\*\(../, "", x); # Kill troff strings
gsub(/\\/, "", x); # Kill all backslashes
gsub(/"/, "", x); # Kill quotes (from .Nd "foo bar")
sub(/<h1 align=center>/, "", x);# Yuk! HTML cruft
gsub(/\000.*/, "X", x); # Binary cruft in LAPACK pages
gsub(/ +/, " ", x); # Collapse spaces (again)
sub(/^ /, "", x); # Kill initial spaces (again)
sub(/ $/, "", x); # Kill trailing spaces (again)
sub(/\.$/, "", x); # Kill trailing period
if (!match(x, / - /))
return;
after_dash = substr(x, RSTART);
head = substr(x, 1, RSTART-1) ", ";
while (match(head, /, /)) {
prog = substr(head, 1, RSTART-1);
head = substr(head, RSTART+2);
if (prog != progname)
prog = prog " [" progname "]";
printf "%-*s (%s) %s\n", 20, prog, actual_section, after_dash;
}
}
{ # Main action - process each filename read in.
filename = $0;
do_one();
}
pages=man section=7 verbose= curdir=/usr/share/man/man7
awk: line 74: syntax error at or near ||
awk: line 75: extra ')'
awk: line 78: syntax error at or near else
awk: line 81: syntax error at or near }
awk: line 151: syntax error at or near }
+ cd ..
+ [ -d man8 ]
+ cd man8
+ section=8
+ curdir=/usr/share/man/man8
+ export section verbose curdir
+ find /usr/share/man/man8/. -name * -type f -size +0 -ctime 0 -print
+ /bin/awk
function readline() {
if (use_zcat || use_bzcat) {
result = (pipe_cmd | getline);
if (result < 0) {
print "Pipe error: " pipe_cmd " " ERRNO > "/dev/stderr";
}
} else {
result = (getline < filename);
if (result < 0) {
print "Read file error: " filename " " ERRNO > "/dev/stderr";
}
}
return result;
}
function closeline() {
if (use_zcat || use_bzcat) {
return close(pipe_cmd);
} else {
return close(filename);
}
}
function do_one() {
insh = 0; thisjoin = 1; done = 0;
entire_line = "";
if (verbose) {
print "adding " filename > "/dev/stderr"
}
use_zcat = match(filename,"\\.Z$") ||
match(filename,"\\.z$") || match(filename,"\\.gz$");
if (!use_zcat)
use_bzcat = match(filename,"\\.bz2");
if (use_zcat || use_bzcat) {
filename_no_gz = substr(filename, 0, RSTART - 1);
} else {
filename_no_gz = filename;
}
match(filename_no_gz, "/[^/]+$");
progname = substr(filename, RSTART + 1, RLENGTH - 1);
if (match(progname, "\\." section "[A-Za-z]+")) {
actual_section = substr(progname, RSTART + 1, RLENGTH - 1);
} else {
actual_section = section;
}
sub(/\..*/, "", progname);
if (use_zcat || use_bzcat) {
if (use_zcat) {
pipe_cmd = "zcat \"" filename "\"";
} else {
pipe_cmd = "bzcat \"" filename "\"";
}
# try to avoid suspicious stuff
if (filename ~ /[;&|`$(]/) {
print "ignored strange file name " filename " in " curdir > "/dev/stderr";
return;
}
}
while (!done && readline() > 0) {
gsub(/.\b/, "");
if (($1 ~ /^\.[Ss][Hh]/ &&
($2 ~ /[Nn][Aa][Mm][Ee]/ ||
$2 ~ /^JMÉNO/ || $2 ~ /^NAVN/ || $2 ~ /^NUME/ ||
$2 ~ /^BEZEICHNUNG/ || $2 ~ /^NOMBRE/ ||
$2 ~ /^NIMI/ || $2 ~ /^NOM/ || $2 ~ /^IME/ ||
$2 ~ /^N[ÉE]V/ || $2 ~ /^NAMA/ || $2 ~ /^̾Á°/ ||
$2 ~ /^̾¾Î/ || $2 ~ /^À̸§/ || $2 ~ /^NAZWA/ ||
$2 ~ /^îáú÷áîéå/ || $2 ~ /^Ãû³Æ/ || $2 ~ /^¦WºÙ/ ||
$2 ~ /^NOME/ || $2 ~ /^NAAM/) || $2 ~ /^ÈÌÅ/)) ||
(pages == "cat" && $1 ~ /^NAME/)) {
if (!insh) {
insh = 1;
} else {
done = 1;
}
} else if (insh) {
if ($1 ~ /^\.[Ss][HhYS]/ ||
(pages == "cat" &&
($1 ~ /^S[yYeE]/ || $1 ~ /^DESCRIPTION/ ||
$1 ~ /^COMMAND/ || $1 ~ /^OVERVIEW/ ||
$1 ~ /^STRUCTURES/ || $1 ~ /^INTRODUCTION/ ||
$0 ~ /^[^ ]/))) {
# end insh for Synopsis, Syntax, but also for
# DESCRIPTION (e.g., XFree86.1x),
# COMMAND (e.g., xspread.1)
# OVERVIEW (e.g., TclCommandWriting.3)
# STRUCTURES (e.g., XEvent.3x)
# INTRODUCTION (e.g., TclX.n)
# and anything at all that begins in Column 1, so
# is probably a section header.
done = 1;
} else {
if ($0 ~ progname"-") { # Fix old cat pages
sub(progname"-", progname" - ");
}
if ($0 ~ /[^ \\]-$/) {
sub(/-$/, ""); # Handle Hyphenations
nextjoin = 1;
} else if ($0 ~ /\\c$/) {
sub(/\\c$/, ""); # Handle Continuations
nextjoin = 1;
} else
nextjoin = 0;
sub(/^.[IB] /, ""); # Kill bold and italics
sub(/^.BI /, ""); #
sub(/^.SM /, ""); # Kill small
sub(/^.Nm /, ""); # Kill bold
sub(/^.Tn /, ""); # Kill normal
sub(/^.Li /, ""); # Kill .Li
sub(/^.Dq /, ""); # Kill .Dq
sub(/^.Nd */, "- "); # Convert .Nd to dash
sub(/\\\".*/, ""); # Trim pending comments
sub(/ *$/, ""); # Trim pending spaces
sub(/^\.$/, ""); # Kill blank comments
sub(/^'.*/, ""); # Kill comment/troff lines
sub(/^.in .*/, ""); # Kill various macros
sub(/^.ti .*/, "");
sub(/^.ta .*/, "");
sub(/^.Vb .*/, "");
sub(/^.[PLTH]P$/, ""); # .PP/.LP/.TP/.HP
sub(/^.Pp$/, "");
sub(/^.[iI]X .*$/, "");
sub(/^.nolinks$/, "");
sub(/^.B$/, "");
sub(/^.nf$/, "");
if (($1 ~ /^\.../ || $1 == "") &&
(entire_line ~ / - / || entire_line ~ / \\- /)) {
# Assume that this ends the description of one line
# Sometimes there are several descriptions in one page,
# as in outb(2).
handle_entire_line();
entire_line = "";
thisjoin = 1;
} else {
if (thisjoin) {
entire_line = entire_line $0;
} else {
entire_line = entire_line " " $0;
}
thisjoin = nextjoin;
}
}
}
}
handle_entire_line();
closeline();
}
function handle_entire_line() {
x = entire_line; # Keep it short
gsub(/\015/, "", x); # Kill DOS remains
gsub(/ /, " ", x); # Translate tabs to spaces
gsub(/ +/, " ", x); # Collapse spaces
gsub(/ *, */, ", ", x); # Fix comma spacings
sub(/^ /, "", x); # Kill initial spaces
sub(/ $/, "", x); # Kill trailing spaces
sub(/__+/, "_", x); # Collapse underscores
gsub(/\\f\(../, "", x); # Kill font changes
gsub(/\\f[PRIB0123]/, "", x); # Kill font changes
gsub(/\\s[-+0-9]*/, "", x); # Kill size changes
gsub(/\\&/, "", x); # Kill \&
gsub(/\\\|/, "", x); # Kill \|
gsub(/\\\((ru|ul)/, "_", x); # Translate
gsub(/\\\((mi|hy|em)/, "-", x); # Translate
gsub(/\\\*\(../, "", x); # Kill troff strings
gsub(/\\/, "", x); # Kill all backslashes
gsub(/"/, "", x); # Kill quotes (from .Nd "foo bar")
sub(/<h1 align=center>/, "", x);# Yuk! HTML cruft
gsub(/\000.*/, "X", x); # Binary cruft in LAPACK pages
gsub(/ +/, " ", x); # Collapse spaces (again)
sub(/^ /, "", x); # Kill initial spaces (again)
sub(/ $/, "", x); # Kill trailing spaces (again)
sub(/\.$/, "", x); # Kill trailing period
if (!match(x, / - /))
return;
after_dash = substr(x, RSTART);
head = substr(x, 1, RSTART-1) ", ";
while (match(head, /, /)) {
prog = substr(head, 1, RSTART-1);
head = substr(head, RSTART+2);
if (prog != progname)
prog = prog " [" progname "]";
printf "%-*s (%s) %s\n", 20, prog, actual_section, after_dash;
}
}
{ # Main action - process each filename read in.
filename = $0;
do_one();
}
pages=man section=8 verbose= curdir=/usr/share/man/man8
awk: line 74: syntax error at or near ||
awk: line 75: extra ')'
awk: line 78: syntax error at or near else
awk: line 81: syntax error at or near }
awk: line 151: syntax error at or near }
+ cd ..
+ [ -d man9 ]
+ [ -d mann ]
+ cd mann
+ section=n
+ curdir=/usr/share/man/mann
+ export section verbose curdir
+ find /usr/share/man/mann/. -name * -type f -size +0 -ctime 0 -print
+ /bin/awk
function readline() {
if (use_zcat || use_bzcat) {
result = (pipe_cmd | getline);
if (result < 0) {
print "Pipe error: " pipe_cmd " " ERRNO > "/dev/stderr";
}
} else {
result = (getline < filename);
if (result < 0) {
print "Read file error: " filename " " ERRNO > "/dev/stderr";
}
}
return result;
}
function closeline() {
if (use_zcat || use_bzcat) {
return close(pipe_cmd);
} else {
return close(filename);
}
}
function do_one() {
insh = 0; thisjoin = 1; done = 0;
entire_line = "";
if (verbose) {
print "adding " filename > "/dev/stderr"
}
use_zcat = match(filename,"\\.Z$") ||
match(filename,"\\.z$") || match(filename,"\\.gz$");
if (!use_zcat)
use_bzcat = match(filename,"\\.bz2");
if (use_zcat || use_bzcat) {
filename_no_gz = substr(filename, 0, RSTART - 1);
} else {
filename_no_gz = filename;
}
match(filename_no_gz, "/[^/]+$");
progname = substr(filename, RSTART + 1, RLENGTH - 1);
if (match(progname, "\\." section "[A-Za-z]+")) {
actual_section = substr(progname, RSTART + 1, RLENGTH - 1);
} else {
actual_section = section;
}
sub(/\..*/, "", progname);
if (use_zcat || use_bzcat) {
if (use_zcat) {
pipe_cmd = "zcat \"" filename "\"";
} else {
pipe_cmd = "bzcat \"" filename "\"";
}
# try to avoid suspicious stuff
if (filename ~ /[;&|`$(]/) {
print "ignored strange file name " filename " in " curdir > "/dev/stderr";
return;
}
}
while (!done && readline() > 0) {
gsub(/.\b/, "");
if (($1 ~ /^\.[Ss][Hh]/ &&
($2 ~ /[Nn][Aa][Mm][Ee]/ ||
$2 ~ /^JMÉNO/ || $2 ~ /^NAVN/ || $2 ~ /^NUME/ ||
$2 ~ /^BEZEICHNUNG/ || $2 ~ /^NOMBRE/ ||
$2 ~ /^NIMI/ || $2 ~ /^NOM/ || $2 ~ /^IME/ ||
$2 ~ /^N[ÉE]V/ || $2 ~ /^NAMA/ || $2 ~ /^̾Á°/ ||
$2 ~ /^̾¾Î/ || $2 ~ /^À̸§/ || $2 ~ /^NAZWA/ ||
$2 ~ /^îáú÷áîéå/ || $2 ~ /^Ãû³Æ/ || $2 ~ /^¦WºÙ/ ||
$2 ~ /^NOME/ || $2 ~ /^NAAM/) || $2 ~ /^ÈÌÅ/)) ||
(pages == "cat" && $1 ~ /^NAME/)) {
if (!insh) {
insh = 1;
} else {
done = 1;
}
} else if (insh) {
if ($1 ~ /^\.[Ss][HhYS]/ ||
(pages == "cat" &&
($1 ~ /^S[yYeE]/ || $1 ~ /^DESCRIPTION/ ||
$1 ~ /^COMMAND/ || $1 ~ /^OVERVIEW/ ||
$1 ~ /^STRUCTURES/ || $1 ~ /^INTRODUCTION/ ||
$0 ~ /^[^ ]/))) {
# end insh for Synopsis, Syntax, but also for
# DESCRIPTION (e.g., XFree86.1x),
# COMMAND (e.g., xspread.1)
# OVERVIEW (e.g., TclCommandWriting.3)
# STRUCTURES (e.g., XEvent.3x)
# INTRODUCTION (e.g., TclX.n)
# and anything at all that begins in Column 1, so
# is probably a section header.
done = 1;
} else {
if ($0 ~ progname"-") { # Fix old cat pages
sub(progname"-", progname" - ");
}
if ($0 ~ /[^ \\]-$/) {
sub(/-$/, ""); # Handle Hyphenations
nextjoin = 1;
} else if ($0 ~ /\\c$/) {
sub(/\\c$/, ""); # Handle Continuations
nextjoin = 1;
} else
nextjoin = 0;
sub(/^.[IB] /, ""); # Kill bold and italics
sub(/^.BI /, ""); #
sub(/^.SM /, ""); # Kill small
sub(/^.Nm /, ""); # Kill bold
sub(/^.Tn /, ""); # Kill normal
sub(/^.Li /, ""); # Kill .Li
sub(/^.Dq /, ""); # Kill .Dq
sub(/^.Nd */, "- "); # Convert .Nd to dash
sub(/\\\".*/, ""); # Trim pending comments
sub(/ *$/, ""); # Trim pending spaces
sub(/^\.$/, ""); # Kill blank comments
sub(/^'.*/, ""); # Kill comment/troff lines
sub(/^.in .*/, ""); # Kill various macros
sub(/^.ti .*/, "");
sub(/^.ta .*/, "");
sub(/^.Vb .*/, "");
sub(/^.[PLTH]P$/, ""); # .PP/.LP/.TP/.HP
sub(/^.Pp$/, "");
sub(/^.[iI]X .*$/, "");
sub(/^.nolinks$/, "");
sub(/^.B$/, "");
sub(/^.nf$/, "");
if (($1 ~ /^\.../ || $1 == "") &&
(entire_line ~ / - / || entire_line ~ / \\- /)) {
# Assume that this ends the description of one line
# Sometimes there are several descriptions in one page,
# as in outb(2).
handle_entire_line();
entire_line = "";
thisjoin = 1;
} else {
if (thisjoin) {
entire_line = entire_line $0;
} else {
entire_line = entire_line " " $0;
}
thisjoin = nextjoin;
}
}
}
}
handle_entire_line();
closeline();
}
function handle_entire_line() {
x = entire_line; # Keep it short
gsub(/\015/, "", x); # Kill DOS remains
gsub(/ /, " ", x); # Translate tabs to spaces
gsub(/ +/, " ", x); # Collapse spaces
gsub(/ *, */, ", ", x); # Fix comma spacings
sub(/^ /, "", x); # Kill initial spaces
sub(/ $/, "", x); # Kill trailing spaces
sub(/__+/, "_", x); # Collapse underscores
gsub(/\\f\(../, "", x); # Kill font changes
gsub(/\\f[PRIB0123]/, "", x); # Kill font changes
gsub(/\\s[-+0-9]*/, "", x); # Kill size changes
gsub(/\\&/, "", x); # Kill \&
gsub(/\\\|/, "", x); # Kill \|
gsub(/\\\((ru|ul)/, "_", x); # Translate
gsub(/\\\((mi|hy|em)/, "-", x); # Translate
gsub(/\\\*\(../, "", x); # Kill troff strings
gsub(/\\/, "", x); # Kill all backslashes
gsub(/"/, "", x); # Kill quotes (from .Nd "foo bar")
sub(/<h1 align=center>/, "", x);# Yuk! HTML cruft
gsub(/\000.*/, "X", x); # Binary cruft in LAPACK pages
gsub(/ +/, " ", x); # Collapse spaces (again)
sub(/^ /, "", x); # Kill initial spaces (again)
sub(/ $/, "", x); # Kill trailing spaces (again)
sub(/\.$/, "", x); # Kill trailing period
if (!match(x, / - /))
return;
after_dash = substr(x, RSTART);
head = substr(x, 1, RSTART-1) ", ";
while (match(head, /, /)) {
prog = substr(head, 1, RSTART-1);
head = substr(head, RSTART+2);
if (prog != progname)
prog = prog " [" progname "]";
printf "%-*s (%s) %s\n", 20, prog, actual_section, after_dash;
}
}
{ # Main action - process each filename read in.
filename = $0;
do_one();
}
pages=man section=n verbose= curdir=/usr/share/man/mann
awk: line 74: syntax error at or near ||
awk: line 75: extra ')'
awk: line 78: syntax error at or near else
awk: line 81: syntax error at or near }
awk: line 151: syntax error at or near }
+ cd ..
+ [ -d manl ]
+ cd manl
+ section=l
+ curdir=/usr/share/man/manl
+ export section verbose curdir
+ find /usr/share/man/manl/. -name * -type f -size +0 -ctime 0 -print
+ /bin/awk
function readline() {
if (use_zcat || use_bzcat) {
result = (pipe_cmd | getline);
if (result < 0) {
print "Pipe error: " pipe_cmd " " ERRNO > "/dev/stderr";
}
} else {
result = (getline < filename);
if (result < 0) {
print "Read file error: " filename " " ERRNO > "/dev/stderr";
}
}
return result;
}
function closeline() {
if (use_zcat || use_bzcat) {
return close(pipe_cmd);
} else {
return close(filename);
}
}
function do_one() {
insh = 0; thisjoin = 1; done = 0;
entire_line = "";
if (verbose) {
print "adding " filename > "/dev/stderr"
}
use_zcat = match(filename,"\\.Z$") ||
match(filename,"\\.z$") || match(filename,"\\.gz$");
if (!use_zcat)
use_bzcat = match(filename,"\\.bz2");
if (use_zcat || use_bzcat) {
filename_no_gz = substr(filename, 0, RSTART - 1);
} else {
filename_no_gz = filename;
}
match(filename_no_gz, "/[^/]+$");
progname = substr(filename, RSTART + 1, RLENGTH - 1);
if (match(progname, "\\." section "[A-Za-z]+")) {
actual_section = substr(progname, RSTART + 1, RLENGTH - 1);
} else {
actual_section = section;
}
sub(/\..*/, "", progname);
if (use_zcat || use_bzcat) {
if (use_zcat) {
pipe_cmd = "zcat \"" filename "\"";
} else {
pipe_cmd = "bzcat \"" filename "\"";
}
# try to avoid suspicious stuff
if (filename ~ /[;&|`$(]/) {
print "ignored strange file name " filename " in " curdir > "/dev/stderr";
return;
}
}
while (!done && readline() > 0) {
gsub(/.\b/, "");
if (($1 ~ /^\.[Ss][Hh]/ &&
($2 ~ /[Nn][Aa][Mm][Ee]/ ||
$2 ~ /^JMÉNO/ || $2 ~ /^NAVN/ || $2 ~ /^NUME/ ||
$2 ~ /^BEZEICHNUNG/ || $2 ~ /^NOMBRE/ ||
$2 ~ /^NIMI/ || $2 ~ /^NOM/ || $2 ~ /^IME/ ||
$2 ~ /^N[ÉE]V/ || $2 ~ /^NAMA/ || $2 ~ /^̾Á°/ ||
$2 ~ /^̾¾Î/ || $2 ~ /^À̸§/ || $2 ~ /^NAZWA/ ||
$2 ~ /^îáú÷áîéå/ || $2 ~ /^Ãû³Æ/ || $2 ~ /^¦WºÙ/ ||
$2 ~ /^NOME/ || $2 ~ /^NAAM/) || $2 ~ /^ÈÌÅ/)) ||
(pages == "cat" && $1 ~ /^NAME/)) {
if (!insh) {
insh = 1;
} else {
done = 1;
}
} else if (insh) {
if ($1 ~ /^\.[Ss][HhYS]/ ||
(pages == "cat" &&
($1 ~ /^S[yYeE]/ || $1 ~ /^DESCRIPTION/ ||
$1 ~ /^COMMAND/ || $1 ~ /^OVERVIEW/ ||
$1 ~ /^STRUCTURES/ || $1 ~ /^INTRODUCTION/ ||
$0 ~ /^[^ ]/))) {
# end insh for Synopsis, Syntax, but also for
# DESCRIPTION (e.g., XFree86.1x),
# COMMAND (e.g., xspread.1)
# OVERVIEW (e.g., TclCommandWriting.3)
# STRUCTURES (e.g., XEvent.3x)
# INTRODUCTION (e.g., TclX.n)
# and anything at all that begins in Column 1, so
# is probably a section header.
done = 1;
} else {
if ($0 ~ progname"-") { # Fix old cat pages
sub(progname"-", progname" - ");
}
if ($0 ~ /[^ \\]-$/) {
sub(/-$/, ""); # Handle Hyphenations
nextjoin = 1;
} else if ($0 ~ /\\c$/) {
sub(/\\c$/, ""); # Handle Continuations
nextjoin = 1;
} else
nextjoin = 0;
sub(/^.[IB] /, ""); # Kill bold and italics
sub(/^.BI /, ""); #
sub(/^.SM /, ""); # Kill small
sub(/^.Nm /, ""); # Kill bold
sub(/^.Tn /, ""); # Kill normal
sub(/^.Li /, ""); # Kill .Li
sub(/^.Dq /, ""); # Kill .Dq
sub(/^.Nd */, "- "); # Convert .Nd to dash
sub(/\\\".*/, ""); # Trim pending comments
sub(/ *$/, ""); # Trim pending spaces
sub(/^\.$/, ""); # Kill blank comments
sub(/^'.*/, ""); # Kill comment/troff lines
sub(/^.in .*/, ""); # Kill various macros
sub(/^.ti .*/, "");
sub(/^.ta .*/, "");
sub(/^.Vb .*/, "");
sub(/^.[PLTH]P$/, ""); # .PP/.LP/.TP/.HP
sub(/^.Pp$/, "");
sub(/^.[iI]X .*$/, "");
sub(/^.nolinks$/, "");
sub(/^.B$/, "");
sub(/^.nf$/, "");
if (($1 ~ /^\.../ || $1 == "") &&
(entire_line ~ / - / || entire_line ~ / \\- /)) {
# Assume that this ends the description of one line
# Sometimes there are several descriptions in one page,
# as in outb(2).
handle_entire_line();
entire_line = "";
thisjoin = 1;
} else {
if (thisjoin) {
entire_line = entire_line $0;
} else {
entire_line = entire_line " " $0;
}
thisjoin = nextjoin;
}
}
}
}
handle_entire_line();
closeline();
}
function handle_entire_line() {
x = entire_line; # Keep it short
gsub(/\015/, "", x); # Kill DOS remains
gsub(/ /, " ", x); # Translate tabs to spaces
gsub(/ +/, " ", x); # Collapse spaces
gsub(/ *, */, ", ", x); # Fix comma spacings
sub(/^ /, "", x); # Kill initial spaces
sub(/ $/, "", x); # Kill trailing spaces
sub(/__+/, "_", x); # Collapse underscores
gsub(/\\f\(../, "", x); # Kill font changes
gsub(/\\f[PRIB0123]/, "", x); # Kill font changes
gsub(/\\s[-+0-9]*/, "", x); # Kill size changes
gsub(/\\&/, "", x); # Kill \&
gsub(/\\\|/, "", x); # Kill \|
gsub(/\\\((ru|ul)/, "_", x); # Translate
gsub(/\\\((mi|hy|em)/, "-", x); # Translate
gsub(/\\\*\(../, "", x); # Kill troff strings
gsub(/\\/, "", x); # Kill all backslashes
gsub(/"/, "", x); # Kill quotes (from .Nd "foo bar")
sub(/<h1 align=center>/, "", x);# Yuk! HTML cruft
gsub(/\000.*/, "X", x); # Binary cruft in LAPACK pages
gsub(/ +/, " ", x); # Collapse spaces (again)
sub(/^ /, "", x); # Kill initial spaces (again)
sub(/ $/, "", x); # Kill trailing spaces (again)
sub(/\.$/, "", x); # Kill trailing period
if (!match(x, / - /))
return;
after_dash = substr(x, RSTART);
head = substr(x, 1, RSTART-1) ", ";
while (match(head, /, /)) {
prog = substr(head, 1, RSTART-1);
head = substr(head, RSTART+2);
if (prog != progname)
prog = prog " [" progname "]";
printf "%-*s (%s) %s\n", 20, prog, actual_section, after_dash;
}
}
{ # Main action - process each filename read in.
filename = $0;
do_one();
}
pages=man section=l verbose= curdir=/usr/share/man/manl
awk: line 74: syntax error at or near ||
awk: line 75: extra ')'
awk: line 78: syntax error at or near else
awk: line 81: syntax error at or near }
awk: line 151: syntax error at or near }
+ cd ..
+ cd /tmp
+ mandir1=/usr/share/man
+ [ x != x ]
+ [ -s /usr/share/man/whatis ]
+ tr -s \n
+ < /var/tmp/tmpwhatisrhNeCA/w
+ sort -u
+ > /usr/share/man/whatis
+ chmod 644 /usr/share/man/whatis
+ rm /var/tmp/tmpwhatisrhNeCA/w
+ [ x != x ]
+ [ -s /usr/X11R6/man/whatis -a man = man -a x1 = x ]
+ pwd
+ here=/tmp
+ cd /usr/X11R6/man
+ > /var/tmp/tmpwhatisrhNeCA/w
+ [ -d man1 ]
+ cd man1
+ section=1
+ curdir=/usr/X11R6/man/man1
+ export section verbose curdir
+ find /usr/X11R6/man/man1/. -name * -type f -size +0 -ctime 0 -print
+ /bin/awk
function readline() {
if (use_zcat || use_bzcat) {
result = (pipe_cmd | getline);
if (result < 0) {
print "Pipe error: " pipe_cmd " " ERRNO > "/dev/stderr";
}
} else {
result = (getline < filename);
if (result < 0) {
print "Read file error: " filename " " ERRNO > "/dev/stderr";
}
}
return result;
}
function closeline() {
if (use_zcat || use_bzcat) {
return close(pipe_cmd);
} else {
return close(filename);
}
}
function do_one() {
insh = 0; thisjoin = 1; done = 0;
entire_line = "";
if (verbose) {
print "adding " filename > "/dev/stderr"
}
use_zcat = match(filename,"\\.Z$") ||
match(filename,"\\.z$") || match(filename,"\\.gz$");
if (!use_zcat)
use_bzcat = match(filename,"\\.bz2");
if (use_zcat || use_bzcat) {
filename_no_gz = substr(filename, 0, RSTART - 1);
} else {
filename_no_gz = filename;
}
match(filename_no_gz, "/[^/]+$");
progname = substr(filename, RSTART + 1, RLENGTH - 1);
if (match(progname, "\\." section "[A-Za-z]+")) {
actual_section = substr(progname, RSTART + 1, RLENGTH - 1);
} else {
actual_section = section;
}
sub(/\..*/, "", progname);
if (use_zcat || use_bzcat) {
if (use_zcat) {
pipe_cmd = "zcat \"" filename "\"";
} else {
pipe_cmd = "bzcat \"" filename "\"";
}
# try to avoid suspicious stuff
if (filename ~ /[;&|`$(]/) {
print "ignored strange file name " filename " in " curdir > "/dev/stderr";
return;
}
}
while (!done && readline() > 0) {
gsub(/.\b/, "");
if (($1 ~ /^\.[Ss][Hh]/ &&
($2 ~ /[Nn][Aa][Mm][Ee]/ ||
$2 ~ /^JMÉNO/ || $2 ~ /^NAVN/ || $2 ~ /^NUME/ ||
$2 ~ /^BEZEICHNUNG/ || $2 ~ /^NOMBRE/ ||
$2 ~ /^NIMI/ || $2 ~ /^NOM/ || $2 ~ /^IME/ ||
$2 ~ /^N[ÉE]V/ || $2 ~ /^NAMA/ || $2 ~ /^̾Á°/ ||
$2 ~ /^̾¾Î/ || $2 ~ /^À̸§/ || $2 ~ /^NAZWA/ ||
$2 ~ /^îáú÷áîéå/ || $2 ~ /^Ãû³Æ/ || $2 ~ /^¦WºÙ/ ||
$2 ~ /^NOME/ || $2 ~ /^NAAM/) || $2 ~ /^ÈÌÅ/)) ||
(pages == "cat" && $1 ~ /^NAME/)) {
if (!insh) {
insh = 1;
} else {
done = 1;
}
} else if (insh) {
if ($1 ~ /^\.[Ss][HhYS]/ ||
(pages == "cat" &&
($1 ~ /^S[yYeE]/ || $1 ~ /^DESCRIPTION/ ||
$1 ~ /^COMMAND/ || $1 ~ /^OVERVIEW/ ||
$1 ~ /^STRUCTURES/ || $1 ~ /^INTRODUCTION/ ||
$0 ~ /^[^ ]/))) {
# end insh for Synopsis, Syntax, but also for
# DESCRIPTION (e.g., XFree86.1x),
# COMMAND (e.g., xspread.1)
# OVERVIEW (e.g., TclCommandWriting.3)
# STRUCTURES (e.g., XEvent.3x)
# INTRODUCTION (e.g., TclX.n)
# and anything at all that begins in Column 1, so
# is probably a section header.
done = 1;
} else {
if ($0 ~ progname"-") { # Fix old cat pages
sub(progname"-", progname" - ");
}
if ($0 ~ /[^ \\]-$/) {
sub(/-$/, ""); # Handle Hyphenations
nextjoin = 1;
} else if ($0 ~ /\\c$/) {
sub(/\\c$/, ""); # Handle Continuations
nextjoin = 1;
} else
nextjoin = 0;
sub(/^.[IB] /, ""); # Kill bold and italics
sub(/^.BI /, ""); #
sub(/^.SM /, ""); # Kill small
sub(/^.Nm /, ""); # Kill bold
sub(/^.Tn /, ""); # Kill normal
sub(/^.Li /, ""); # Kill .Li
sub(/^.Dq /, ""); # Kill .Dq
sub(/^.Nd */, "- "); # Convert .Nd to dash
sub(/\\\".*/, ""); # Trim pending comments
sub(/ *$/, ""); # Trim pending spaces
sub(/^\.$/, ""); # Kill blank comments
sub(/^'.*/, ""); # Kill comment/troff lines
sub(/^.in .*/, ""); # Kill various macros
sub(/^.ti .*/, "");
sub(/^.ta .*/, "");
sub(/^.Vb .*/, "");
sub(/^.[PLTH]P$/, ""); # .PP/.LP/.TP/.HP
sub(/^.Pp$/, "");
sub(/^.[iI]X .*$/, "");
sub(/^.nolinks$/, "");
sub(/^.B$/, "");
sub(/^.nf$/, "");
if (($1 ~ /^\.../ || $1 == "") &&
(entire_line ~ / - / || entire_line ~ / \\- /)) {
# Assume that this ends the description of one line
# Sometimes there are several descriptions in one page,
# as in outb(2).
handle_entire_line();
entire_line = "";
thisjoin = 1;
} else {
if (thisjoin) {
entire_line = entire_line $0;
} else {
entire_line = entire_line " " $0;
}
thisjoin = nextjoin;
}
}
}
}
handle_entire_line();
closeline();
}
function handle_entire_line() {
x = entire_line; # Keep it short
gsub(/\015/, "", x); # Kill DOS remains
gsub(/ /, " ", x); # Translate tabs to spaces
gsub(/ +/, " ", x); # Collapse spaces
gsub(/ *, */, ", ", x); # Fix comma spacings
sub(/^ /, "", x); # Kill initial spaces
sub(/ $/, "", x); # Kill trailing spaces
sub(/__+/, "_", x); # Collapse underscores
gsub(/\\f\(../, "", x); # Kill font changes
gsub(/\\f[PRIB0123]/, "", x); # Kill font changes
gsub(/\\s[-+0-9]*/, "", x); # Kill size changes
gsub(/\\&/, "", x); # Kill \&
gsub(/\\\|/, "", x); # Kill \|
gsub(/\\\((ru|ul)/, "_", x); # Translate
gsub(/\\\((mi|hy|em)/, "-", x); # Translate
gsub(/\\\*\(../, "", x); # Kill troff strings
gsub(/\\/, "", x); # Kill all backslashes
gsub(/"/, "", x); # Kill quotes (from .Nd "foo bar")
sub(/<h1 align=center>/, "", x);# Yuk! HTML cruft
gsub(/\000.*/, "X", x); # Binary cruft in LAPACK pages
gsub(/ +/, " ", x); # Collapse spaces (again)
sub(/^ /, "", x); # Kill initial spaces (again)
sub(/ $/, "", x); # Kill trailing spaces (again)
sub(/\.$/, "", x); # Kill trailing period
if (!match(x, / - /))
return;
after_dash = substr(x, RSTART);
head = substr(x, 1, RSTART-1) ", ";
while (match(head, /, /)) {
prog = substr(head, 1, RSTART-1);
head = substr(head, RSTART+2);
if (prog != progname)
prog = prog " [" progname "]";
printf "%-*s (%s) %s\n", 20, prog, actual_section, after_dash;
}
}
{ # Main action - process each filename read in.
filename = $0;
do_one();
}
pages=man section=1 verbose= curdir=/usr/X11R6/man/man1
awk: line 74: syntax error at or near ||
awk: line 75: extra ')'
awk: line 78: syntax error at or near else
awk: line 81: syntax error at or near }
awk: line 151: syntax error at or near }
+ cd ..
+ [ -d man2 ]
+ cd man2
+ section=2
+ curdir=/usr/X11R6/man/man2
+ export section verbose curdir
+ find /usr/X11R6/man/man2/. -name * -type f -size +0 -ctime 0 -print
+ /bin/awk
function readline() {
if (use_zcat || use_bzcat) {
result = (pipe_cmd | getline);
if (result < 0) {
print "Pipe error: " pipe_cmd " " ERRNO > "/dev/stderr";
}
} else {
result = (getline < filename);
if (result < 0) {
print "Read file error: " filename " " ERRNO > "/dev/stderr";
}
}
return result;
}
function closeline() {
if (use_zcat || use_bzcat) {
return close(pipe_cmd);
} else {
return close(filename);
}
}
function do_one() {
insh = 0; thisjoin = 1; done = 0;
entire_line = "";
if (verbose) {
print "adding " filename > "/dev/stderr"
}
use_zcat = match(filename,"\\.Z$") ||
match(filename,"\\.z$") || match(filename,"\\.gz$");
if (!use_zcat)
use_bzcat = match(filename,"\\.bz2");
if (use_zcat || use_bzcat) {
filename_no_gz = substr(filename, 0, RSTART - 1);
} else {
filename_no_gz = filename;
}
match(filename_no_gz, "/[^/]+$");
progname = substr(filename, RSTART + 1, RLENGTH - 1);
if (match(progname, "\\." section "[A-Za-z]+")) {
actual_section = substr(progname, RSTART + 1, RLENGTH - 1);
} else {
actual_section = section;
}
sub(/\..*/, "", progname);
if (use_zcat || use_bzcat) {
if (use_zcat) {
pipe_cmd = "zcat \"" filename "\"";
} else {
pipe_cmd = "bzcat \"" filename "\"";
}
# try to avoid suspicious stuff
if (filename ~ /[;&|`$(]/) {
print "ignored strange file name " filename " in " curdir > "/dev/stderr";
return;
}
}
while (!done && readline() > 0) {
gsub(/.\b/, "");
if (($1 ~ /^\.[Ss][Hh]/ &&
($2 ~ /[Nn][Aa][Mm][Ee]/ ||
$2 ~ /^JMÉNO/ || $2 ~ /^NAVN/ || $2 ~ /^NUME/ ||
$2 ~ /^BEZEICHNUNG/ || $2 ~ /^NOMBRE/ ||
$2 ~ /^NIMI/ || $2 ~ /^NOM/ || $2 ~ /^IME/ ||
$2 ~ /^N[ÉE]V/ || $2 ~ /^NAMA/ || $2 ~ /^̾Á°/ ||
$2 ~ /^̾¾Î/ || $2 ~ /^À̸§/ || $2 ~ /^NAZWA/ ||
$2 ~ /^îáú÷áîéå/ || $2 ~ /^Ãû³Æ/ || $2 ~ /^¦WºÙ/ ||
$2 ~ /^NOME/ || $2 ~ /^NAAM/) || $2 ~ /^ÈÌÅ/)) ||
(pages == "cat" && $1 ~ /^NAME/)) {
if (!insh) {
insh = 1;
} else {
done = 1;
}
} else if (insh) {
if ($1 ~ /^\.[Ss][HhYS]/ ||
(pages == "cat" &&
($1 ~ /^S[yYeE]/ || $1 ~ /^DESCRIPTION/ ||
$1 ~ /^COMMAND/ || $1 ~ /^OVERVIEW/ ||
$1 ~ /^STRUCTURES/ || $1 ~ /^INTRODUCTION/ ||
$0 ~ /^[^ ]/))) {
# end insh for Synopsis, Syntax, but also for
# DESCRIPTION (e.g., XFree86.1x),
# COMMAND (e.g., xspread.1)
# OVERVIEW (e.g., TclCommandWriting.3)
# STRUCTURES (e.g., XEvent.3x)
# INTRODUCTION (e.g., TclX.n)
# and anything at all that begins in Column 1, so
# is probably a section header.
done = 1;
} else {
if ($0 ~ progname"-") { # Fix old cat pages
sub(progname"-", progname" - ");
}
if ($0 ~ /[^ \\]-$/) {
sub(/-$/, ""); # Handle Hyphenations
nextjoin = 1;
} else if ($0 ~ /\\c$/) {
sub(/\\c$/, ""); # Handle Continuations
nextjoin = 1;
} else
nextjoin = 0;
sub(/^.[IB] /, ""); # Kill bold and italics
sub(/^.BI /, ""); #
sub(/^.SM /, ""); # Kill small
sub(/^.Nm /, ""); # Kill bold
sub(/^.Tn /, ""); # Kill normal
sub(/^.Li /, ""); # Kill .Li
sub(/^.Dq /, ""); # Kill .Dq
sub(/^.Nd */, "- "); # Convert .Nd to dash
sub(/\\\".*/, ""); # Trim pending comments
sub(/ *$/, ""); # Trim pending spaces
sub(/^\.$/, ""); # Kill blank comments
sub(/^'.*/, ""); # Kill comment/troff lines
sub(/^.in .*/, ""); # Kill various macros
sub(/^.ti .*/, "");
sub(/^.ta .*/, "");
sub(/^.Vb .*/, "");
sub(/^.[PLTH]P$/, ""); # .PP/.LP/.TP/.HP
sub(/^.Pp$/, "");
sub(/^.[iI]X .*$/, "");
sub(/^.nolinks$/, "");
sub(/^.B$/, "");
sub(/^.nf$/, "");
if (($1 ~ /^\.../ || $1 == "") &&
(entire_line ~ / - / || entire_line ~ / \\- /)) {
# Assume that this ends the description of one line
# Sometimes there are several descriptions in one page,
# as in outb(2).
handle_entire_line();
entire_line = "";
thisjoin = 1;
} else {
if (thisjoin) {
entire_line = entire_line $0;
} else {
entire_line = entire_line " " $0;
}
thisjoin = nextjoin;
}
}
}
}
handle_entire_line();
closeline();
}
function handle_entire_line() {
x = entire_line; # Keep it short
gsub(/\015/, "", x); # Kill DOS remains
gsub(/ /, " ", x); # Translate tabs to spaces
gsub(/ +/, " ", x); # Collapse spaces
gsub(/ *, */, ", ", x); # Fix comma spacings
sub(/^ /, "", x); # Kill initial spaces
sub(/ $/, "", x); # Kill trailing spaces
sub(/__+/, "_", x); # Collapse underscores
gsub(/\\f\(../, "", x); # Kill font changes
gsub(/\\f[PRIB0123]/, "", x); # Kill font changes
gsub(/\\s[-+0-9]*/, "", x); # Kill size changes
gsub(/\\&/, "", x); # Kill \&
gsub(/\\\|/, "", x); # Kill \|
gsub(/\\\((ru|ul)/, "_", x); # Translate
gsub(/\\\((mi|hy|em)/, "-", x); # Translate
gsub(/\\\*\(../, "", x); # Kill troff strings
gsub(/\\/, "", x); # Kill all backslashes
gsub(/"/, "", x); # Kill quotes (from .Nd "foo bar")
sub(/<h1 align=center>/, "", x);# Yuk! HTML cruft
gsub(/\000.*/, "X", x); # Binary cruft in LAPACK pages
gsub(/ +/, " ", x); # Collapse spaces (again)
sub(/^ /, "", x); # Kill initial spaces (again)
sub(/ $/, "", x); # Kill trailing spaces (again)
sub(/\.$/, "", x); # Kill trailing period
if (!match(x, / - /))
return;
after_dash = substr(x, RSTART);
head = substr(x, 1, RSTART-1) ", ";
while (match(head, /, /)) {
prog = substr(head, 1, RSTART-1);
head = substr(head, RSTART+2);
if (prog != progname)
prog = prog " [" progname "]";
printf "%-*s (%s) %s\n", 20, prog, actual_section, after_dash;
}
}
{ # Main action - process each filename read in.
filename = $0;
do_one();
}
pages=man section=2 verbose= curdir=/usr/X11R6/man/man2
awk: line 74: syntax error at or near ||
awk: line 75: extra ')'
awk: line 78: syntax error at or near else
awk: line 81: syntax error at or near }
awk: line 151: syntax error at or near }
+ cd ..
+ [ -d man3 ]
+ cd man3
+ section=3
+ curdir=/usr/X11R6/man/man3
+ export section verbose curdir
+ find /usr/X11R6/man/man3/. -name * -type f -size +0 -ctime 0 -print
+ /bin/awk
function readline() {
if (use_zcat || use_bzcat) {
result = (pipe_cmd | getline);
if (result < 0) {
print "Pipe error: " pipe_cmd " " ERRNO > "/dev/stderr";
}
} else {
result = (getline < filename);
if (result < 0) {
print "Read file error: " filename " " ERRNO > "/dev/stderr";
}
}
return result;
}
function closeline() {
if (use_zcat || use_bzcat) {
return close(pipe_cmd);
} else {
return close(filename);
}
}
function do_one() {
insh = 0; thisjoin = 1; done = 0;
entire_line = "";
if (verbose) {
print "adding " filename > "/dev/stderr"
}
use_zcat = match(filename,"\\.Z$") ||
match(filename,"\\.z$") || match(filename,"\\.gz$");
if (!use_zcat)
use_bzcat = match(filename,"\\.bz2");
if (use_zcat || use_bzcat) {
filename_no_gz = substr(filename, 0, RSTART - 1);
} else {
filename_no_gz = filename;
}
match(filename_no_gz, "/[^/]+$");
progname = substr(filename, RSTART + 1, RLENGTH - 1);
if (match(progname, "\\." section "[A-Za-z]+")) {
actual_section = substr(progname, RSTART + 1, RLENGTH - 1);
} else {
actual_section = section;
}
sub(/\..*/, "", progname);
if (use_zcat || use_bzcat) {
if (use_zcat) {
pipe_cmd = "zcat \"" filename "\"";
} else {
pipe_cmd = "bzcat \"" filename "\"";
}
# try to avoid suspicious stuff
if (filename ~ /[;&|`$(]/) {
print "ignored strange file name " filename " in " curdir > "/dev/stderr";
return;
}
}
while (!done && readline() > 0) {
gsub(/.\b/, "");
if (($1 ~ /^\.[Ss][Hh]/ &&
($2 ~ /[Nn][Aa][Mm][Ee]/ ||
$2 ~ /^JMÉNO/ || $2 ~ /^NAVN/ || $2 ~ /^NUME/ ||
$2 ~ /^BEZEICHNUNG/ || $2 ~ /^NOMBRE/ ||
$2 ~ /^NIMI/ || $2 ~ /^NOM/ || $2 ~ /^IME/ ||
$2 ~ /^N[ÉE]V/ || $2 ~ /^NAMA/ || $2 ~ /^̾Á°/ ||
$2 ~ /^̾¾Î/ || $2 ~ /^À̸§/ || $2 ~ /^NAZWA/ ||
$2 ~ /^îáú÷áîéå/ || $2 ~ /^Ãû³Æ/ || $2 ~ /^¦WºÙ/ ||
$2 ~ /^NOME/ || $2 ~ /^NAAM/) || $2 ~ /^ÈÌÅ/)) ||
(pages == "cat" && $1 ~ /^NAME/)) {
if (!insh) {
insh = 1;
} else {
done = 1;
}
} else if (insh) {
if ($1 ~ /^\.[Ss][HhYS]/ ||
(pages == "cat" &&
($1 ~ /^S[yYeE]/ || $1 ~ /^DESCRIPTION/ ||
$1 ~ /^COMMAND/ || $1 ~ /^OVERVIEW/ ||
$1 ~ /^STRUCTURES/ || $1 ~ /^INTRODUCTION/ ||
$0 ~ /^[^ ]/))) {
# end insh for Synopsis, Syntax, but also for
# DESCRIPTION (e.g., XFree86.1x),
# COMMAND (e.g., xspread.1)
# OVERVIEW (e.g., TclCommandWriting.3)
# STRUCTURES (e.g., XEvent.3x)
# INTRODUCTION (e.g., TclX.n)
# and anything at all that begins in Column 1, so
# is probably a section header.
done = 1;
} else {
if ($0 ~ progname"-") { # Fix old cat pages
sub(progname"-", progname" - ");
}
if ($0 ~ /[^ \\]-$/) {
sub(/-$/, ""); # Handle Hyphenations
nextjoin = 1;
} else if ($0 ~ /\\c$/) {
sub(/\\c$/, ""); # Handle Continuations
nextjoin = 1;
} else
nextjoin = 0;
sub(/^.[IB] /, ""); # Kill bold and italics
sub(/^.BI /, ""); #
sub(/^.SM /, ""); # Kill small
sub(/^.Nm /, ""); # Kill bold
sub(/^.Tn /, ""); # Kill normal
sub(/^.Li /, ""); # Kill .Li
sub(/^.Dq /, ""); # Kill .Dq
sub(/^.Nd */, "- "); # Convert .Nd to dash
sub(/\\\".*/, ""); # Trim pending comments
sub(/ *$/, ""); # Trim pending spaces
sub(/^\.$/, ""); # Kill blank comments
sub(/^'.*/, ""); # Kill comment/troff lines
sub(/^.in .*/, ""); # Kill various macros
sub(/^.ti .*/, "");
sub(/^.ta .*/, "");
sub(/^.Vb .*/, "");
sub(/^.[PLTH]P$/, ""); # .PP/.LP/.TP/.HP
sub(/^.Pp$/, "");
sub(/^.[iI]X .*$/, "");
sub(/^.nolinks$/, "");
sub(/^.B$/, "");
sub(/^.nf$/, "");
if (($1 ~ /^\.../ || $1 == "") &&
(entire_line ~ / - / || entire_line ~ / \\- /)) {
# Assume that this ends the description of one line
# Sometimes there are several descriptions in one page,
# as in outb(2).
handle_entire_line();
entire_line = "";
thisjoin = 1;
} else {
if (thisjoin) {
entire_line = entire_line $0;
} else {
entire_line = entire_line " " $0;
}
thisjoin = nextjoin;
}
}
}
}
handle_entire_line();
closeline();
}
function handle_entire_line() {
x = entire_line; # Keep it short
gsub(/\015/, "", x); # Kill DOS remains
gsub(/ /, " ", x); # Translate tabs to spaces
gsub(/ +/, " ", x); # Collapse spaces
gsub(/ *, */, ", ", x); # Fix comma spacings
sub(/^ /, "", x); # Kill initial spaces
sub(/ $/, "", x); # Kill trailing spaces
sub(/__+/, "_", x); # Collapse underscores
gsub(/\\f\(../, "", x); # Kill font changes
gsub(/\\f[PRIB0123]/, "", x); # Kill font changes
gsub(/\\s[-+0-9]*/, "", x); # Kill size changes
gsub(/\\&/, "", x); # Kill \&
gsub(/\\\|/, "", x); # Kill \|
gsub(/\\\((ru|ul)/, "_", x); # Translate
gsub(/\\\((mi|hy|em)/, "-", x); # Translate
gsub(/\\\*\(../, "", x); # Kill troff strings
gsub(/\\/, "", x); # Kill all backslashes
gsub(/"/, "", x); # Kill quotes (from .Nd "foo bar")
sub(/<h1 align=center>/, "", x);# Yuk! HTML cruft
gsub(/\000.*/, "X", x); # Binary cruft in LAPACK pages
gsub(/ +/, " ", x); # Collapse spaces (again)
sub(/^ /, "", x); # Kill initial spaces (again)
sub(/ $/, "", x); # Kill trailing spaces (again)
sub(/\.$/, "", x); # Kill trailing period
if (!match(x, / - /))
return;
after_dash = substr(x, RSTART);
head = substr(x, 1, RSTART-1) ", ";
while (match(head, /, /)) {
prog = substr(head, 1, RSTART-1);
head = substr(head, RSTART+2);
if (prog != progname)
prog = prog " [" progname "]";
printf "%-*s (%s) %s\n", 20, prog, actual_section, after_dash;
}
}
{ # Main action - process each filename read in.
filename = $0;
do_one();
}
pages=man section=3 verbose= curdir=/usr/X11R6/man/man3
awk: line 74: syntax error at or near ||
awk: line 75: extra ')'
awk: line 78: syntax error at or near else
awk: line 81: syntax error at or near }
awk: line 151: syntax error at or near }
+ cd ..
+ [ -d man4 ]
+ cd man4
+ section=4
+ curdir=/usr/X11R6/man/man4
+ export section verbose curdir
+ find /usr/X11R6/man/man4/. -name * -type f -size +0 -ctime 0 -print
+ /bin/awk
function readline() {
if (use_zcat || use_bzcat) {
result = (pipe_cmd | getline);
if (result < 0) {
print "Pipe error: " pipe_cmd " " ERRNO > "/dev/stderr";
}
} else {
result = (getline < filename);
if (result < 0) {
print "Read file error: " filename " " ERRNO > "/dev/stderr";
}
}
return result;
}
function closeline() {
if (use_zcat || use_bzcat) {
return close(pipe_cmd);
} else {
return close(filename);
}
}
function do_one() {
insh = 0; thisjoin = 1; done = 0;
entire_line = "";
if (verbose) {
print "adding " filename > "/dev/stderr"
}
use_zcat = match(filename,"\\.Z$") ||
match(filename,"\\.z$") || match(filename,"\\.gz$");
if (!use_zcat)
use_bzcat = match(filename,"\\.bz2");
if (use_zcat || use_bzcat) {
filename_no_gz = substr(filename, 0, RSTART - 1);
} else {
filename_no_gz = filename;
}
match(filename_no_gz, "/[^/]+$");
progname = substr(filename, RSTART + 1, RLENGTH - 1);
if (match(progname, "\\." section "[A-Za-z]+")) {
actual_section = substr(progname, RSTART + 1, RLENGTH - 1);
} else {
actual_section = section;
}
sub(/\..*/, "", progname);
if (use_zcat || use_bzcat) {
if (use_zcat) {
pipe_cmd = "zcat \"" filename "\"";
} else {
pipe_cmd = "bzcat \"" filename "\"";
}
# try to avoid suspicious stuff
if (filename ~ /[;&|`$(]/) {
print "ignored strange file name " filename " in " curdir > "/dev/stderr";
return;
}
}
while (!done && readline() > 0) {
gsub(/.\b/, "");
if (($1 ~ /^\.[Ss][Hh]/ &&
($2 ~ /[Nn][Aa][Mm][Ee]/ ||
$2 ~ /^JMÉNO/ || $2 ~ /^NAVN/ || $2 ~ /^NUME/ ||
$2 ~ /^BEZEICHNUNG/ || $2 ~ /^NOMBRE/ ||
$2 ~ /^NIMI/ || $2 ~ /^NOM/ || $2 ~ /^IME/ ||
$2 ~ /^N[ÉE]V/ || $2 ~ /^NAMA/ || $2 ~ /^̾Á°/ ||
$2 ~ /^̾¾Î/ || $2 ~ /^À̸§/ || $2 ~ /^NAZWA/ ||
$2 ~ /^îáú÷áîéå/ || $2 ~ /^Ãû³Æ/ || $2 ~ /^¦WºÙ/ ||
$2 ~ /^NOME/ || $2 ~ /^NAAM/) || $2 ~ /^ÈÌÅ/)) ||
(pages == "cat" && $1 ~ /^NAME/)) {
if (!insh) {
insh = 1;
} else {
done = 1;
}
} else if (insh) {
if ($1 ~ /^\.[Ss][HhYS]/ ||
(pages == "cat" &&
($1 ~ /^S[yYeE]/ || $1 ~ /^DESCRIPTION/ ||
$1 ~ /^COMMAND/ || $1 ~ /^OVERVIEW/ ||
$1 ~ /^STRUCTURES/ || $1 ~ /^INTRODUCTION/ ||
$0 ~ /^[^ ]/))) {
# end insh for Synopsis, Syntax, but also for
# DESCRIPTION (e.g., XFree86.1x),
# COMMAND (e.g., xspread.1)
# OVERVIEW (e.g., TclCommandWriting.3)
# STRUCTURES (e.g., XEvent.3x)
# INTRODUCTION (e.g., TclX.n)
# and anything at all that begins in Column 1, so
# is probably a section header.
done = 1;
} else {
if ($0 ~ progname"-") { # Fix old cat pages
sub(progname"-", progname" - ");
}
if ($0 ~ /[^ \\]-$/) {
sub(/-$/, ""); # Handle Hyphenations
nextjoin = 1;
} else if ($0 ~ /\\c$/) {
sub(/\\c$/, ""); # Handle Continuations
nextjoin = 1;
} else
nextjoin = 0;
sub(/^.[IB] /, ""); # Kill bold and italics
sub(/^.BI /, ""); #
sub(/^.SM /, ""); # Kill small
sub(/^.Nm /, ""); # Kill bold
sub(/^.Tn /, ""); # Kill normal
sub(/^.Li /, ""); # Kill .Li
sub(/^.Dq /, ""); # Kill .Dq
sub(/^.Nd */, "- "); # Convert .Nd to dash
sub(/\\\".*/, ""); # Trim pending comments
sub(/ *$/, ""); # Trim pending spaces
sub(/^\.$/, ""); # Kill blank comments
sub(/^'.*/, ""); # Kill comment/troff lines
sub(/^.in .*/, ""); # Kill various macros
sub(/^.ti .*/, "");
sub(/^.ta .*/, "");
sub(/^.Vb .*/, "");
sub(/^.[PLTH]P$/, ""); # .PP/.LP/.TP/.HP
sub(/^.Pp$/, "");
sub(/^.[iI]X .*$/, "");
sub(/^.nolinks$/, "");
sub(/^.B$/, "");
sub(/^.nf$/, "");
if (($1 ~ /^\.../ || $1 == "") &&
(entire_line ~ / - / || entire_line ~ / \\- /)) {
# Assume that this ends the description of one line
# Sometimes there are several descriptions in one page,
# as in outb(2).
handle_entire_line();
entire_line = "";
thisjoin = 1;
} else {
if (thisjoin) {
entire_line = entire_line $0;
} else {
entire_line = entire_line " " $0;
}
thisjoin = nextjoin;
}
}
}
}
handle_entire_line();
closeline();
}
function handle_entire_line() {
x = entire_line; # Keep it short
gsub(/\015/, "", x); # Kill DOS remains
gsub(/ /, " ", x); # Translate tabs to spaces
gsub(/ +/, " ", x); # Collapse spaces
gsub(/ *, */, ", ", x); # Fix comma spacings
sub(/^ /, "", x); # Kill initial spaces
sub(/ $/, "", x); # Kill trailing spaces
sub(/__+/, "_", x); # Collapse underscores
gsub(/\\f\(../, "", x); # Kill font changes
gsub(/\\f[PRIB0123]/, "", x); # Kill font changes
gsub(/\\s[-+0-9]*/, "", x); # Kill size changes
gsub(/\\&/, "", x); # Kill \&
gsub(/\\\|/, "", x); # Kill \|
gsub(/\\\((ru|ul)/, "_", x); # Translate
gsub(/\\\((mi|hy|em)/, "-", x); # Translate
gsub(/\\\*\(../, "", x); # Kill troff strings
gsub(/\\/, "", x); # Kill all backslashes
gsub(/"/, "", x); # Kill quotes (from .Nd "foo bar")
sub(/<h1 align=center>/, "", x);# Yuk! HTML cruft
gsub(/\000.*/, "X", x); # Binary cruft in LAPACK pages
gsub(/ +/, " ", x); # Collapse spaces (again)
sub(/^ /, "", x); # Kill initial spaces (again)
sub(/ $/, "", x); # Kill trailing spaces (again)
sub(/\.$/, "", x); # Kill trailing period
if (!match(x, / - /))
return;
after_dash = substr(x, RSTART);
head = substr(x, 1, RSTART-1) ", ";
while (match(head, /, /)) {
prog = substr(head, 1, RSTART-1);
head = substr(head, RSTART+2);
if (prog != progname)
prog = prog " [" progname "]";
printf "%-*s (%s) %s\n", 20, prog, actual_section, after_dash;
}
}
{ # Main action - process each filename read in.
filename = $0;
do_one();
}
pages=man section=4 verbose= curdir=/usr/X11R6/man/man4
awk: line 74: syntax error at or near ||
awk: line 75: extra ')'
awk: line 78: syntax error at or near else
awk: line 81: syntax error at or near }
awk: line 151: syntax error at or near }
+ cd ..
+ [ -d man5 ]
+ cd man5
+ section=5
+ curdir=/usr/X11R6/man/man5
+ export section verbose curdir
+ find /usr/X11R6/man/man5/. -name * -type f -size +0 -ctime 0 -print
+ /bin/awk
function readline() {
if (use_zcat || use_bzcat) {
result = (pipe_cmd | getline);
if (result < 0) {
print "Pipe error: " pipe_cmd " " ERRNO > "/dev/stderr";
}
} else {
result = (getline < filename);
if (result < 0) {
print "Read file error: " filename " " ERRNO > "/dev/stderr";
}
}
return result;
}
function closeline() {
if (use_zcat || use_bzcat) {
return close(pipe_cmd);
} else {
return close(filename);
}
}
function do_one() {
insh = 0; thisjoin = 1; done = 0;
entire_line = "";
if (verbose) {
print "adding " filename > "/dev/stderr"
}
use_zcat = match(filename,"\\.Z$") ||
match(filename,"\\.z$") || match(filename,"\\.gz$");
if (!use_zcat)
use_bzcat = match(filename,"\\.bz2");
if (use_zcat || use_bzcat) {
filename_no_gz = substr(filename, 0, RSTART - 1);
} else {
filename_no_gz = filename;
}
match(filename_no_gz, "/[^/]+$");
progname = substr(filename, RSTART + 1, RLENGTH - 1);
if (match(progname, "\\." section "[A-Za-z]+")) {
actual_section = substr(progname, RSTART + 1, RLENGTH - 1);
} else {
actual_section = section;
}
sub(/\..*/, "", progname);
if (use_zcat || use_bzcat) {
if (use_zcat) {
pipe_cmd = "zcat \"" filename "\"";
} else {
pipe_cmd = "bzcat \"" filename "\"";
}
# try to avoid suspicious stuff
if (filename ~ /[;&|`$(]/) {
print "ignored strange file name " filename " in " curdir > "/dev/stderr";
return;
}
}
while (!done && readline() > 0) {
gsub(/.\b/, "");
if (($1 ~ /^\.[Ss][Hh]/ &&
($2 ~ /[Nn][Aa][Mm][Ee]/ ||
$2 ~ /^JMÉNO/ || $2 ~ /^NAVN/ || $2 ~ /^NUME/ ||
$2 ~ /^BEZEICHNUNG/ || $2 ~ /^NOMBRE/ ||
$2 ~ /^NIMI/ || $2 ~ /^NOM/ || $2 ~ /^IME/ ||
$2 ~ /^N[ÉE]V/ || $2 ~ /^NAMA/ || $2 ~ /^̾Á°/ ||
$2 ~ /^̾¾Î/ || $2 ~ /^À̸§/ || $2 ~ /^NAZWA/ ||
$2 ~ /^îáú÷áîéå/ || $2 ~ /^Ãû³Æ/ || $2 ~ /^¦WºÙ/ ||
$2 ~ /^NOME/ || $2 ~ /^NAAM/) || $2 ~ /^ÈÌÅ/)) ||
(pages == "cat" && $1 ~ /^NAME/)) {
if (!insh) {
insh = 1;
} else {
done = 1;
}
} else if (insh) {
if ($1 ~ /^\.[Ss][HhYS]/ ||
(pages == "cat" &&
($1 ~ /^S[yYeE]/ || $1 ~ /^DESCRIPTION/ ||
$1 ~ /^COMMAND/ || $1 ~ /^OVERVIEW/ ||
$1 ~ /^STRUCTURES/ || $1 ~ /^INTRODUCTION/ ||
$0 ~ /^[^ ]/))) {
# end insh for Synopsis, Syntax, but also for
# DESCRIPTION (e.g., XFree86.1x),
# COMMAND (e.g., xspread.1)
# OVERVIEW (e.g., TclCommandWriting.3)
# STRUCTURES (e.g., XEvent.3x)
# INTRODUCTION (e.g., TclX.n)
# and anything at all that begins in Column 1, so
# is probably a section header.
done = 1;
} else {
if ($0 ~ progname"-") { # Fix old cat pages
sub(progname"-", progname" - ");
}
if ($0 ~ /[^ \\]-$/) {
sub(/-$/, ""); # Handle Hyphenations
nextjoin = 1;
} else if ($0 ~ /\\c$/) {
sub(/\\c$/, ""); # Handle Continuations
nextjoin = 1;
} else
nextjoin = 0;
sub(/^.[IB] /, ""); # Kill bold and italics
sub(/^.BI /, ""); #
sub(/^.SM /, ""); # Kill small
sub(/^.Nm /, ""); # Kill bold
sub(/^.Tn /, ""); # Kill normal
sub(/^.Li /, ""); # Kill .Li
sub(/^.Dq /, ""); # Kill .Dq
sub(/^.Nd */, "- "); # Convert .Nd to dash
sub(/\\\".*/, ""); # Trim pending comments
sub(/ *$/, ""); # Trim pending spaces
sub(/^\.$/, ""); # Kill blank comments
sub(/^'.*/, ""); # Kill comment/troff lines
sub(/^.in .*/, ""); # Kill various macros
sub(/^.ti .*/, "");
sub(/^.ta .*/, "");
sub(/^.Vb .*/, "");
sub(/^.[PLTH]P$/, ""); # .PP/.LP/.TP/.HP
sub(/^.Pp$/, "");
sub(/^.[iI]X .*$/, "");
sub(/^.nolinks$/, "");
sub(/^.B$/, "");
sub(/^.nf$/, "");
if (($1 ~ /^\.../ || $1 == "") &&
(entire_line ~ / - / || entire_line ~ / \\- /)) {
# Assume that this ends the description of one line
# Sometimes there are several descriptions in one page,
# as in outb(2).
handle_entire_line();
entire_line = "";
thisjoin = 1;
} else {
if (thisjoin) {
entire_line = entire_line $0;
} else {
entire_line = entire_line " " $0;
}
thisjoin = nextjoin;
}
}
}
}
handle_entire_line();
closeline();
}
function handle_entire_line() {
x = entire_line; # Keep it short
gsub(/\015/, "", x); # Kill DOS remains
gsub(/ /, " ", x); # Translate tabs to spaces
gsub(/ +/, " ", x); # Collapse spaces
gsub(/ *, */, ", ", x); # Fix comma spacings
sub(/^ /, "", x); # Kill initial spaces
sub(/ $/, "", x); # Kill trailing spaces
sub(/__+/, "_", x); # Collapse underscores
gsub(/\\f\(../, "", x); # Kill font changes
gsub(/\\f[PRIB0123]/, "", x); # Kill font changes
gsub(/\\s[-+0-9]*/, "", x); # Kill size changes
gsub(/\\&/, "", x); # Kill \&
gsub(/\\\|/, "", x); # Kill \|
gsub(/\\\((ru|ul)/, "_", x); # Translate
gsub(/\\\((mi|hy|em)/, "-", x); # Translate
gsub(/\\\*\(../, "", x); # Kill troff strings
gsub(/\\/, "", x); # Kill all backslashes
gsub(/"/, "", x); # Kill quotes (from .Nd "foo bar")
sub(/<h1 align=center>/, "", x);# Yuk! HTML cruft
gsub(/\000.*/, "X", x); # Binary cruft in LAPACK pages
gsub(/ +/, " ", x); # Collapse spaces (again)
sub(/^ /, "", x); # Kill initial spaces (again)
sub(/ $/, "", x); # Kill trailing spaces (again)
sub(/\.$/, "", x); # Kill trailing period
if (!match(x, / - /))
return;
after_dash = substr(x, RSTART);
head = substr(x, 1, RSTART-1) ", ";
while (match(head, /, /)) {
prog = substr(head, 1, RSTART-1);
head = substr(head, RSTART+2);
if (prog != progname)
prog = prog " [" progname "]";
printf "%-*s (%s) %s\n", 20, prog, actual_section, after_dash;
}
}
{ # Main action - process each filename read in.
filename = $0;
do_one();
}
pages=man section=5 verbose= curdir=/usr/X11R6/man/man5
awk: line 74: syntax error at or near ||
awk: line 75: extra ')'
awk: line 78: syntax error at or near else
awk: line 81: syntax error at or near }
awk: line 151: syntax error at or near }
+ cd ..
+ [ -d man6 ]
+ cd man6
+ section=6
+ curdir=/usr/X11R6/man/man6
+ export section verbose curdir
+ find /usr/X11R6/man/man6/. -name * -type f -size +0 -ctime 0 -print
+ /bin/awk
function readline() {
if (use_zcat || use_bzcat) {
result = (pipe_cmd | getline);
if (result < 0) {
print "Pipe error: " pipe_cmd " " ERRNO > "/dev/stderr";
}
} else {
result = (getline < filename);
if (result < 0) {
print "Read file error: " filename " " ERRNO > "/dev/stderr";
}
}
return result;
}
function closeline() {
if (use_zcat || use_bzcat) {
return close(pipe_cmd);
} else {
return close(filename);
}
}
function do_one() {
insh = 0; thisjoin = 1; done = 0;
entire_line = "";
if (verbose) {
print "adding " filename > "/dev/stderr"
}
use_zcat = match(filename,"\\.Z$") ||
match(filename,"\\.z$") || match(filename,"\\.gz$");
if (!use_zcat)
use_bzcat = match(filename,"\\.bz2");
if (use_zcat || use_bzcat) {
filename_no_gz = substr(filename, 0, RSTART - 1);
} else {
filename_no_gz = filename;
}
match(filename_no_gz, "/[^/]+$");
progname = substr(filename, RSTART + 1, RLENGTH - 1);
if (match(progname, "\\." section "[A-Za-z]+")) {
actual_section = substr(progname, RSTART + 1, RLENGTH - 1);
} else {
actual_section = section;
}
sub(/\..*/, "", progname);
if (use_zcat || use_bzcat) {
if (use_zcat) {
pipe_cmd = "zcat \"" filename "\"";
} else {
pipe_cmd = "bzcat \"" filename "\"";
}
# try to avoid suspicious stuff
if (filename ~ /[;&|`$(]/) {
print "ignored strange file name " filename " in " curdir > "/dev/stderr";
return;
}
}
while (!done && readline() > 0) {
gsub(/.\b/, "");
if (($1 ~ /^\.[Ss][Hh]/ &&
($2 ~ /[Nn][Aa][Mm][Ee]/ ||
$2 ~ /^JMÉNO/ || $2 ~ /^NAVN/ || $2 ~ /^NUME/ ||
$2 ~ /^BEZEICHNUNG/ || $2 ~ /^NOMBRE/ ||
$2 ~ /^NIMI/ || $2 ~ /^NOM/ || $2 ~ /^IME/ ||
$2 ~ /^N[ÉE]V/ || $2 ~ /^NAMA/ || $2 ~ /^̾Á°/ ||
$2 ~ /^̾¾Î/ || $2 ~ /^À̸§/ || $2 ~ /^NAZWA/ ||
$2 ~ /^îáú÷áîéå/ || $2 ~ /^Ãû³Æ/ || $2 ~ /^¦WºÙ/ ||
$2 ~ /^NOME/ || $2 ~ /^NAAM/) || $2 ~ /^ÈÌÅ/)) ||
(pages == "cat" && $1 ~ /^NAME/)) {
if (!insh) {
insh = 1;
} else {
done = 1;
}
} else if (insh) {
if ($1 ~ /^\.[Ss][HhYS]/ ||
(pages == "cat" &&
($1 ~ /^S[yYeE]/ || $1 ~ /^DESCRIPTION/ ||
$1 ~ /^COMMAND/ || $1 ~ /^OVERVIEW/ ||
$1 ~ /^STRUCTURES/ || $1 ~ /^INTRODUCTION/ ||
$0 ~ /^[^ ]/))) {
# end insh for Synopsis, Syntax, but also for
# DESCRIPTION (e.g., XFree86.1x),
# COMMAND (e.g., xspread.1)
# OVERVIEW (e.g., TclCommandWriting.3)
# STRUCTURES (e.g., XEvent.3x)
# INTRODUCTION (e.g., TclX.n)
# and anything at all that begins in Column 1, so
# is probably a section header.
done = 1;
} else {
if ($0 ~ progname"-") { # Fix old cat pages
sub(progname"-", progname" - ");
}
if ($0 ~ /[^ \\]-$/) {
sub(/-$/, ""); # Handle Hyphenations
nextjoin = 1;
} else if ($0 ~ /\\c$/) {
sub(/\\c$/, ""); # Handle Continuations
nextjoin = 1;
} else
nextjoin = 0;
sub(/^.[IB] /, ""); # Kill bold and italics
sub(/^.BI /, ""); #
sub(/^.SM /, ""); # Kill small
sub(/^.Nm /, ""); # Kill bold
sub(/^.Tn /, ""); # Kill normal
sub(/^.Li /, ""); # Kill .Li
sub(/^.Dq /, ""); # Kill .Dq
sub(/^.Nd */, "- "); # Convert .Nd to dash
sub(/\\\".*/, ""); # Trim pending comments
sub(/ *$/, ""); # Trim pending spaces
sub(/^\.$/, ""); # Kill blank comments
sub(/^'.*/, ""); # Kill comment/troff lines
sub(/^.in .*/, ""); # Kill various macros
sub(/^.ti .*/, "");
sub(/^.ta .*/, "");
sub(/^.Vb .*/, "");
sub(/^.[PLTH]P$/, ""); # .PP/.LP/.TP/.HP
sub(/^.Pp$/, "");
sub(/^.[iI]X .*$/, "");
sub(/^.nolinks$/, "");
sub(/^.B$/, "");
sub(/^.nf$/, "");
if (($1 ~ /^\.../ || $1 == "") &&
(entire_line ~ / - / || entire_line ~ / \\- /)) {
# Assume that this ends the description of one line
# Sometimes there are several descriptions in one page,
# as in outb(2).
handle_entire_line();
entire_line = "";
thisjoin = 1;
} else {
if (thisjoin) {
entire_line = entire_line $0;
} else {
entire_line = entire_line " " $0;
}
thisjoin = nextjoin;
}
}
}
}
handle_entire_line();
closeline();
}
function handle_entire_line() {
x = entire_line; # Keep it short
gsub(/\015/, "", x); # Kill DOS remains
gsub(/ /, " ", x); # Translate tabs to spaces
gsub(/ +/, " ", x); # Collapse spaces
gsub(/ *, */, ", ", x); # Fix comma spacings
sub(/^ /, "", x); # Kill initial spaces
sub(/ $/, "", x); # Kill trailing spaces
sub(/__+/, "_", x); # Collapse underscores
gsub(/\\f\(../, "", x); # Kill font changes
gsub(/\\f[PRIB0123]/, "", x); # Kill font changes
gsub(/\\s[-+0-9]*/, "", x); # Kill size changes
gsub(/\\&/, "", x); # Kill \&
gsub(/\\\|/, "", x); # Kill \|
gsub(/\\\((ru|ul)/, "_", x); # Translate
gsub(/\\\((mi|hy|em)/, "-", x); # Translate
gsub(/\\\*\(../, "", x); # Kill troff strings
gsub(/\\/, "", x); # Kill all backslashes
gsub(/"/, "", x); # Kill quotes (from .Nd "foo bar")
sub(/<h1 align=center>/, "", x);# Yuk! HTML cruft
gsub(/\000.*/, "X", x); # Binary cruft in LAPACK pages
gsub(/ +/, " ", x); # Collapse spaces (again)
sub(/^ /, "", x); # Kill initial spaces (again)
sub(/ $/, "", x); # Kill trailing spaces (again)
sub(/\.$/, "", x); # Kill trailing period
if (!match(x, / - /))
return;
after_dash = substr(x, RSTART);
head = substr(x, 1, RSTART-1) ", ";
while (match(head, /, /)) {
prog = substr(head, 1, RSTART-1);
head = substr(head, RSTART+2);
if (prog != progname)
prog = prog " [" progname "]";
printf "%-*s (%s) %s\n", 20, prog, actual_section, after_dash;
}
}
{ # Main action - process each filename read in.
filename = $0;
do_one();
}
pages=man section=6 verbose= curdir=/usr/X11R6/man/man6
awk: line 74: syntax error at or near ||
awk: line 75: extra ')'
awk: line 78: syntax error at or near else
awk: line 81: syntax error at or near }
awk: line 151: syntax error at or near }
+ cd ..
+ [ -d man7 ]
+ cd man7
+ section=7
+ curdir=/usr/X11R6/man/man7
+ export section verbose curdir
+ find /usr/X11R6/man/man7/. -name * -type f -size +0 -ctime 0 -print
+ /bin/awk
function readline() {
if (use_zcat || use_bzcat) {
result = (pipe_cmd | getline);
if (result < 0) {
print "Pipe error: " pipe_cmd " " ERRNO > "/dev/stderr";
}
} else {
result = (getline < filename);
if (result < 0) {
print "Read file error: " filename " " ERRNO > "/dev/stderr";
}
}
return result;
}
function closeline() {
if (use_zcat || use_bzcat) {
return close(pipe_cmd);
} else {
return close(filename);
}
}
function do_one() {
insh = 0; thisjoin = 1; done = 0;
entire_line = "";
if (verbose) {
print "adding " filename > "/dev/stderr"
}
use_zcat = match(filename,"\\.Z$") ||
match(filename,"\\.z$") || match(filename,"\\.gz$");
if (!use_zcat)
use_bzcat = match(filename,"\\.bz2");
if (use_zcat || use_bzcat) {
filename_no_gz = substr(filename, 0, RSTART - 1);
} else {
filename_no_gz = filename;
}
match(filename_no_gz, "/[^/]+$");
progname = substr(filename, RSTART + 1, RLENGTH - 1);
if (match(progname, "\\." section "[A-Za-z]+")) {
actual_section = substr(progname, RSTART + 1, RLENGTH - 1);
} else {
actual_section = section;
}
sub(/\..*/, "", progname);
if (use_zcat || use_bzcat) {
if (use_zcat) {
pipe_cmd = "zcat \"" filename "\"";
} else {
pipe_cmd = "bzcat \"" filename "\"";
}
# try to avoid suspicious stuff
if (filename ~ /[;&|`$(]/) {
print "ignored strange file name " filename " in " curdir > "/dev/stderr";
return;
}
}
while (!done && readline() > 0) {
gsub(/.\b/, "");
if (($1 ~ /^\.[Ss][Hh]/ &&
($2 ~ /[Nn][Aa][Mm][Ee]/ ||
$2 ~ /^JMÉNO/ || $2 ~ /^NAVN/ || $2 ~ /^NUME/ ||
$2 ~ /^BEZEICHNUNG/ || $2 ~ /^NOMBRE/ ||
$2 ~ /^NIMI/ || $2 ~ /^NOM/ || $2 ~ /^IME/ ||
$2 ~ /^N[ÉE]V/ || $2 ~ /^NAMA/ || $2 ~ /^̾Á°/ ||
$2 ~ /^̾¾Î/ || $2 ~ /^À̸§/ || $2 ~ /^NAZWA/ ||
$2 ~ /^îáú÷áîéå/ || $2 ~ /^Ãû³Æ/ || $2 ~ /^¦WºÙ/ ||
$2 ~ /^NOME/ || $2 ~ /^NAAM/) || $2 ~ /^ÈÌÅ/)) ||
(pages == "cat" && $1 ~ /^NAME/)) {
if (!insh) {
insh = 1;
} else {
done = 1;
}
} else if (insh) {
if ($1 ~ /^\.[Ss][HhYS]/ ||
(pages == "cat" &&
($1 ~ /^S[yYeE]/ || $1 ~ /^DESCRIPTION/ ||
$1 ~ /^COMMAND/ || $1 ~ /^OVERVIEW/ ||
$1 ~ /^STRUCTURES/ || $1 ~ /^INTRODUCTION/ ||
$0 ~ /^[^ ]/))) {
# end insh for Synopsis, Syntax, but also for
# DESCRIPTION (e.g., XFree86.1x),
# COMMAND (e.g., xspread.1)
# OVERVIEW (e.g., TclCommandWriting.3)
# STRUCTURES (e.g., XEvent.3x)
# INTRODUCTION (e.g., TclX.n)
# and anything at all that begins in Column 1, so
# is probably a section header.
done = 1;
} else {
if ($0 ~ progname"-") { # Fix old cat pages
sub(progname"-", progname" - ");
}
if ($0 ~ /[^ \\]-$/) {
sub(/-$/, ""); # Handle Hyphenations
nextjoin = 1;
} else if ($0 ~ /\\c$/) {
sub(/\\c$/, ""); # Handle Continuations
nextjoin = 1;
} else
nextjoin = 0;
sub(/^.[IB] /, ""); # Kill bold and italics
sub(/^.BI /, ""); #
sub(/^.SM /, ""); # Kill small
sub(/^.Nm /, ""); # Kill bold
sub(/^.Tn /, ""); # Kill normal
sub(/^.Li /, ""); # Kill .Li
sub(/^.Dq /, ""); # Kill .Dq
sub(/^.Nd */, "- "); # Convert .Nd to dash
sub(/\\\".*/, ""); # Trim pending comments
sub(/ *$/, ""); # Trim pending spaces
sub(/^\.$/, ""); # Kill blank comments
sub(/^'.*/, ""); # Kill comment/troff lines
sub(/^.in .*/, ""); # Kill various macros
sub(/^.ti .*/, "");
sub(/^.ta .*/, "");
sub(/^.Vb .*/, "");
sub(/^.[PLTH]P$/, ""); # .PP/.LP/.TP/.HP
sub(/^.Pp$/, "");
sub(/^.[iI]X .*$/, "");
sub(/^.nolinks$/, "");
sub(/^.B$/, "");
sub(/^.nf$/, "");
if (($1 ~ /^\.../ || $1 == "") &&
(entire_line ~ / - / || entire_line ~ / \\- /)) {
# Assume that this ends the description of one line
# Sometimes there are several descriptions in one page,
# as in outb(2).
handle_entire_line();
entire_line = "";
thisjoin = 1;
} else {
if (thisjoin) {
entire_line = entire_line $0;
} else {
entire_line = entire_line " " $0;
}
thisjoin = nextjoin;
}
}
}
}
handle_entire_line();
closeline();
}
function handle_entire_line() {
x = entire_line; # Keep it short
gsub(/\015/, "", x); # Kill DOS remains
gsub(/ /, " ", x); # Translate tabs to spaces
gsub(/ +/, " ", x); # Collapse spaces
gsub(/ *, */, ", ", x); # Fix comma spacings
sub(/^ /, "", x); # Kill initial spaces
sub(/ $/, "", x); # Kill trailing spaces
sub(/__+/, "_", x); # Collapse underscores
gsub(/\\f\(../, "", x); # Kill font changes
gsub(/\\f[PRIB0123]/, "", x); # Kill font changes
gsub(/\\s[-+0-9]*/, "", x); # Kill size changes
gsub(/\\&/, "", x); # Kill \&
gsub(/\\\|/, "", x); # Kill \|
gsub(/\\\((ru|ul)/, "_", x); # Translate
gsub(/\\\((mi|hy|em)/, "-", x); # Translate
gsub(/\\\*\(../, "", x); # Kill troff strings
gsub(/\\/, "", x); # Kill all backslashes
gsub(/"/, "", x); # Kill quotes (from .Nd "foo bar")
sub(/<h1 align=center>/, "", x);# Yuk! HTML cruft
gsub(/\000.*/, "X", x); # Binary cruft in LAPACK pages
gsub(/ +/, " ", x); # Collapse spaces (again)
sub(/^ /, "", x); # Kill initial spaces (again)
sub(/ $/, "", x); # Kill trailing spaces (again)
sub(/\.$/, "", x); # Kill trailing period
if (!match(x, / - /))
return;
after_dash = substr(x, RSTART);
head = substr(x, 1, RSTART-1) ", ";
while (match(head, /, /)) {
prog = substr(head, 1, RSTART-1);
head = substr(head, RSTART+2);
if (prog != progname)
prog = prog " [" progname "]";
printf "%-*s (%s) %s\n", 20, prog, actual_section, after_dash;
}
}
{ # Main action - process each filename read in.
filename = $0;
do_one();
}
pages=man section=7 verbose= curdir=/usr/X11R6/man/man7
awk: line 74: syntax error at or near ||
awk: line 75: extra ')'
awk: line 78: syntax error at or near else
awk: line 81: syntax error at or near }
awk: line 151: syntax error at or near }
+ cd ..
+ [ -d man8 ]
+ cd man8
+ section=8
+ curdir=/usr/X11R6/man/man8
+ export section verbose curdir
+ find /usr/X11R6/man/man8/. -name * -type f -size +0 -ctime 0 -print
+ /bin/awk
function readline() {
if (use_zcat || use_bzcat) {
result = (pipe_cmd | getline);
if (result < 0) {
print "Pipe error: " pipe_cmd " " ERRNO > "/dev/stderr";
}
} else {
result = (getline < filename);
if (result < 0) {
print "Read file error: " filename " " ERRNO > "/dev/stderr";
}
}
return result;
}
function closeline() {
if (use_zcat || use_bzcat) {
return close(pipe_cmd);
} else {
return close(filename);
}
}
function do_one() {
insh = 0; thisjoin = 1; done = 0;
entire_line = "";
if (verbose) {
print "adding " filename > "/dev/stderr"
}
use_zcat = match(filename,"\\.Z$") ||
match(filename,"\\.z$") || match(filename,"\\.gz$");
if (!use_zcat)
use_bzcat = match(filename,"\\.bz2");
if (use_zcat || use_bzcat) {
filename_no_gz = substr(filename, 0, RSTART - 1);
} else {
filename_no_gz = filename;
}
match(filename_no_gz, "/[^/]+$");
progname = substr(filename, RSTART + 1, RLENGTH - 1);
if (match(progname, "\\." section "[A-Za-z]+")) {
actual_section = substr(progname, RSTART + 1, RLENGTH - 1);
} else {
actual_section = section;
}
sub(/\..*/, "", progname);
if (use_zcat || use_bzcat) {
if (use_zcat) {
pipe_cmd = "zcat \"" filename "\"";
} else {
pipe_cmd = "bzcat \"" filename "\"";
}
# try to avoid suspicious stuff
if (filename ~ /[;&|`$(]/) {
print "ignored strange file name " filename " in " curdir > "/dev/stderr";
return;
}
}
while (!done && readline() > 0) {
gsub(/.\b/, "");
if (($1 ~ /^\.[Ss][Hh]/ &&
($2 ~ /[Nn][Aa][Mm][Ee]/ ||
$2 ~ /^JMÉNO/ || $2 ~ /^NAVN/ || $2 ~ /^NUME/ ||
$2 ~ /^BEZEICHNUNG/ || $2 ~ /^NOMBRE/ ||
$2 ~ /^NIMI/ || $2 ~ /^NOM/ || $2 ~ /^IME/ ||
$2 ~ /^N[ÉE]V/ || $2 ~ /^NAMA/ || $2 ~ /^̾Á°/ ||
$2 ~ /^̾¾Î/ || $2 ~ /^À̸§/ || $2 ~ /^NAZWA/ ||
$2 ~ /^îáú÷áîéå/ || $2 ~ /^Ãû³Æ/ || $2 ~ /^¦WºÙ/ ||
$2 ~ /^NOME/ || $2 ~ /^NAAM/) || $2 ~ /^ÈÌÅ/)) ||
(pages == "cat" && $1 ~ /^NAME/)) {
if (!insh) {
insh = 1;
} else {
done = 1;
}
} else if (insh) {
if ($1 ~ /^\.[Ss][HhYS]/ ||
(pages == "cat" &&
($1 ~ /^S[yYeE]/ || $1 ~ /^DESCRIPTION/ ||
$1 ~ /^COMMAND/ || $1 ~ /^OVERVIEW/ ||
$1 ~ /^STRUCTURES/ || $1 ~ /^INTRODUCTION/ ||
$0 ~ /^[^ ]/))) {
# end insh for Synopsis, Syntax, but also for
# DESCRIPTION (e.g., XFree86.1x),
# COMMAND (e.g., xspread.1)
# OVERVIEW (e.g., TclCommandWriting.3)
# STRUCTURES (e.g., XEvent.3x)
# INTRODUCTION (e.g., TclX.n)
# and anything at all that begins in Column 1, so
# is probably a section header.
done = 1;
} else {
if ($0 ~ progname"-") { # Fix old cat pages
sub(progname"-", progname" - ");
}
if ($0 ~ /[^ \\]-$/) {
sub(/-$/, ""); # Handle Hyphenations
nextjoin = 1;
} else if ($0 ~ /\\c$/) {
sub(/\\c$/, ""); # Handle Continuations
nextjoin = 1;
} else
nextjoin = 0;
sub(/^.[IB] /, ""); # Kill bold and italics
sub(/^.BI /, ""); #
sub(/^.SM /, ""); # Kill small
sub(/^.Nm /, ""); # Kill bold
sub(/^.Tn /, ""); # Kill normal
sub(/^.Li /, ""); # Kill .Li
sub(/^.Dq /, ""); # Kill .Dq
sub(/^.Nd */, "- "); # Convert .Nd to dash
sub(/\\\".*/, ""); # Trim pending comments
sub(/ *$/, ""); # Trim pending spaces
sub(/^\.$/, ""); # Kill blank comments
sub(/^'.*/, ""); # Kill comment/troff lines
sub(/^.in .*/, ""); # Kill various macros
sub(/^.ti .*/, "");
sub(/^.ta .*/, "");
sub(/^.Vb .*/, "");
sub(/^.[PLTH]P$/, ""); # .PP/.LP/.TP/.HP
sub(/^.Pp$/, "");
sub(/^.[iI]X .*$/, "");
sub(/^.nolinks$/, "");
sub(/^.B$/, "");
sub(/^.nf$/, "");
if (($1 ~ /^\.../ || $1 == "") &&
(entire_line ~ / - / || entire_line ~ / \\- /)) {
# Assume that this ends the description of one line
# Sometimes there are several descriptions in one page,
# as in outb(2).
handle_entire_line();
entire_line = "";
thisjoin = 1;
} else {
if (thisjoin) {
entire_line = entire_line $0;
} else {
entire_line = entire_line " " $0;
}
thisjoin = nextjoin;
}
}
}
}
handle_entire_line();
closeline();
}
function handle_entire_line() {
x = entire_line; # Keep it short
gsub(/\015/, "", x); # Kill DOS remains
gsub(/ /, " ", x); # Translate tabs to spaces
gsub(/ +/, " ", x); # Collapse spaces
gsub(/ *, */, ", ", x); # Fix comma spacings
sub(/^ /, "", x); # Kill initial spaces
sub(/ $/, "", x); # Kill trailing spaces
sub(/__+/, "_", x); # Collapse underscores
gsub(/\\f\(../, "", x); # Kill font changes
gsub(/\\f[PRIB0123]/, "", x); # Kill font changes
gsub(/\\s[-+0-9]*/, "", x); # Kill size changes
gsub(/\\&/, "", x); # Kill \&
gsub(/\\\|/, "", x); # Kill \|
gsub(/\\\((ru|ul)/, "_", x); # Translate
gsub(/\\\((mi|hy|em)/, "-", x); # Translate
gsub(/\\\*\(../, "", x); # Kill troff strings
gsub(/\\/, "", x); # Kill all backslashes
gsub(/"/, "", x); # Kill quotes (from .Nd "foo bar")
sub(/<h1 align=center>/, "", x);# Yuk! HTML cruft
gsub(/\000.*/, "X", x); # Binary cruft in LAPACK pages
gsub(/ +/, " ", x); # Collapse spaces (again)
sub(/^ /, "", x); # Kill initial spaces (again)
sub(/ $/, "", x); # Kill trailing spaces (again)
sub(/\.$/, "", x); # Kill trailing period
if (!match(x, / - /))
return;
after_dash = substr(x, RSTART);
head = substr(x, 1, RSTART-1) ", ";
while (match(head, /, /)) {
prog = substr(head, 1, RSTART-1);
head = substr(head, RSTART+2);
if (prog != progname)
prog = prog " [" progname "]";
printf "%-*s (%s) %s\n", 20, prog, actual_section, after_dash;
}
}
{ # Main action - process each filename read in.
filename = $0;
do_one();
}
pages=man section=8 verbose= curdir=/usr/X11R6/man/man8
awk: line 74: syntax error at or near ||
awk: line 75: extra ')'
awk: line 78: syntax error at or near else
awk: line 81: syntax error at or near }
awk: line 151: syntax error at or near }
+ cd ..
+ [ -d man9 ]
+ [ -d mann ]
+ [ -d manl ]
+ cd /tmp
+ mandir1=/usr/X11R6/man
+ [ x != x ]
+ [ -s /usr/X11R6/man/whatis ]
+ tr -s \n
+ < /var/tmp/tmpwhatisrhNeCA/w
+ sort -u
+ > /usr/X11R6/man/whatis
+ chmod 644 /usr/X11R6/man/whatis
+ rm /var/tmp/tmpwhatisrhNeCA/w
+ [ x != x ]
+ [ -s /usr/local/share/man/whatis -a man = man -a x1 = x ]
+ pwd
+ here=/tmp
+ cd /usr/local/share/man
+ > /var/tmp/tmpwhatisrhNeCA/w
+ [ -d man1 ]
+ cd man1
+ section=1
+ curdir=/usr/local/share/man/man1
+ export section verbose curdir
+ find /usr/local/share/man/man1/. -name * -type f -size +0 -ctime 0 -print
+ /bin/awk
function readline() {
if (use_zcat || use_bzcat) {
result = (pipe_cmd | getline);
if (result < 0) {
print "Pipe error: " pipe_cmd " " ERRNO > "/dev/stderr";
}
} else {
result = (getline < filename);
if (result < 0) {
print "Read file error: " filename " " ERRNO > "/dev/stderr";
}
}
return result;
}
function closeline() {
if (use_zcat || use_bzcat) {
return close(pipe_cmd);
} else {
return close(filename);
}
}
function do_one() {
insh = 0; thisjoin = 1; done = 0;
entire_line = "";
if (verbose) {
print "adding " filename > "/dev/stderr"
}
use_zcat = match(filename,"\\.Z$") ||
match(filename,"\\.z$") || match(filename,"\\.gz$");
if (!use_zcat)
use_bzcat = match(filename,"\\.bz2");
if (use_zcat || use_bzcat) {
filename_no_gz = substr(filename, 0, RSTART - 1);
} else {
filename_no_gz = filename;
}
match(filename_no_gz, "/[^/]+$");
progname = substr(filename, RSTART + 1, RLENGTH - 1);
if (match(progname, "\\." section "[A-Za-z]+")) {
actual_section = substr(progname, RSTART + 1, RLENGTH - 1);
} else {
actual_section = section;
}
sub(/\..*/, "", progname);
if (use_zcat || use_bzcat) {
if (use_zcat) {
pipe_cmd = "zcat \"" filename "\"";
} else {
pipe_cmd = "bzcat \"" filename "\"";
}
# try to avoid suspicious stuff
if (filename ~ /[;&|`$(]/) {
print "ignored strange file name " filename " in " curdir > "/dev/stderr";
return;
}
}
while (!done && readline() > 0) {
gsub(/.\b/, "");
if (($1 ~ /^\.[Ss][Hh]/ &&
($2 ~ /[Nn][Aa][Mm][Ee]/ ||
$2 ~ /^JMÉNO/ || $2 ~ /^NAVN/ || $2 ~ /^NUME/ ||
$2 ~ /^BEZEICHNUNG/ || $2 ~ /^NOMBRE/ ||
$2 ~ /^NIMI/ || $2 ~ /^NOM/ || $2 ~ /^IME/ ||
$2 ~ /^N[ÉE]V/ || $2 ~ /^NAMA/ || $2 ~ /^̾Á°/ ||
$2 ~ /^̾¾Î/ || $2 ~ /^À̸§/ || $2 ~ /^NAZWA/ ||
$2 ~ /^îáú÷áîéå/ || $2 ~ /^Ãû³Æ/ || $2 ~ /^¦WºÙ/ ||
$2 ~ /^NOME/ || $2 ~ /^NAAM/) || $2 ~ /^ÈÌÅ/)) ||
(pages == "cat" && $1 ~ /^NAME/)) {
if (!insh) {
insh = 1;
} else {
done = 1;
}
} else if (insh) {
if ($1 ~ /^\.[Ss][HhYS]/ ||
(pages == "cat" &&
($1 ~ /^S[yYeE]/ || $1 ~ /^DESCRIPTION/ ||
$1 ~ /^COMMAND/ || $1 ~ /^OVERVIEW/ ||
$1 ~ /^STRUCTURES/ || $1 ~ /^INTRODUCTION/ ||
$0 ~ /^[^ ]/))) {
# end insh for Synopsis, Syntax, but also for
# DESCRIPTION (e.g., XFree86.1x),
# COMMAND (e.g., xspread.1)
# OVERVIEW (e.g., TclCommandWriting.3)
# STRUCTURES (e.g., XEvent.3x)
# INTRODUCTION (e.g., TclX.n)
# and anything at all that begins in Column 1, so
# is probably a section header.
done = 1;
} else {
if ($0 ~ progname"-") { # Fix old cat pages
sub(progname"-", progname" - ");
}
if ($0 ~ /[^ \\]-$/) {
sub(/-$/, ""); # Handle Hyphenations
nextjoin = 1;
} else if ($0 ~ /\\c$/) {
sub(/\\c$/, ""); # Handle Continuations
nextjoin = 1;
} else
nextjoin = 0;
sub(/^.[IB] /, ""); # Kill bold and italics
sub(/^.BI /, ""); #
sub(/^.SM /, ""); # Kill small
sub(/^.Nm /, ""); # Kill bold
sub(/^.Tn /, ""); # Kill normal
sub(/^.Li /, ""); # Kill .Li
sub(/^.Dq /, ""); # Kill .Dq
sub(/^.Nd */, "- "); # Convert .Nd to dash
sub(/\\\".*/, ""); # Trim pending comments
sub(/ *$/, ""); # Trim pending spaces
sub(/^\.$/, ""); # Kill blank comments
sub(/^'.*/, ""); # Kill comment/troff lines
sub(/^.in .*/, ""); # Kill various macros
sub(/^.ti .*/, "");
sub(/^.ta .*/, "");
sub(/^.Vb .*/, "");
sub(/^.[PLTH]P$/, ""); # .PP/.LP/.TP/.HP
sub(/^.Pp$/, "");
sub(/^.[iI]X .*$/, "");
sub(/^.nolinks$/, "");
sub(/^.B$/, "");
sub(/^.nf$/, "");
if (($1 ~ /^\.../ || $1 == "") &&
(entire_line ~ / - / || entire_line ~ / \\- /)) {
# Assume that this ends the description of one line
# Sometimes there are several descriptions in one page,
# as in outb(2).
handle_entire_line();
entire_line = "";
thisjoin = 1;
} else {
if (thisjoin) {
entire_line = entire_line $0;
} else {
entire_line = entire_line " " $0;
}
thisjoin = nextjoin;
}
}
}
}
handle_entire_line();
closeline();
}
function handle_entire_line() {
x = entire_line; # Keep it short
gsub(/\015/, "", x); # Kill DOS remains
gsub(/ /, " ", x); # Translate tabs to spaces
gsub(/ +/, " ", x); # Collapse spaces
gsub(/ *, */, ", ", x); # Fix comma spacings
sub(/^ /, "", x); # Kill initial spaces
sub(/ $/, "", x); # Kill trailing spaces
sub(/__+/, "_", x); # Collapse underscores
gsub(/\\f\(../, "", x); # Kill font changes
gsub(/\\f[PRIB0123]/, "", x); # Kill font changes
gsub(/\\s[-+0-9]*/, "", x); # Kill size changes
gsub(/\\&/, "", x); # Kill \&
gsub(/\\\|/, "", x); # Kill \|
gsub(/\\\((ru|ul)/, "_", x); # Translate
gsub(/\\\((mi|hy|em)/, "-", x); # Translate
gsub(/\\\*\(../, "", x); # Kill troff strings
gsub(/\\/, "", x); # Kill all backslashes
gsub(/"/, "", x); # Kill quotes (from .Nd "foo bar")
sub(/<h1 align=center>/, "", x);# Yuk! HTML cruft
gsub(/\000.*/, "X", x); # Binary cruft in LAPACK pages
gsub(/ +/, " ", x); # Collapse spaces (again)
sub(/^ /, "", x); # Kill initial spaces (again)
sub(/ $/, "", x); # Kill trailing spaces (again)
sub(/\.$/, "", x); # Kill trailing period
if (!match(x, / - /))
return;
after_dash = substr(x, RSTART);
head = substr(x, 1, RSTART-1) ", ";
while (match(head, /, /)) {
prog = substr(head, 1, RSTART-1);
head = substr(head, RSTART+2);
if (prog != progname)
prog = prog " [" progname "]";
printf "%-*s (%s) %s\n", 20, prog, actual_section, after_dash;
}
}
{ # Main action - process each filename read in.
filename = $0;
do_one();
}
pages=man section=1 verbose= curdir=/usr/local/share/man/man1
awk: line 74: syntax error at or near ||
awk: line 75: extra ')'
awk: line 78: syntax error at or near else
awk: line 81: syntax error at or near }
awk: line 151: syntax error at or near }
+ cd ..
+ [ -d man2 ]
+ cd man2
+ section=2
+ curdir=/usr/local/share/man/man2
+ export section verbose curdir
+ find /usr/local/share/man/man2/. -name * -type f -size +0 -ctime 0 -print
+ /bin/awk
function readline() {
if (use_zcat || use_bzcat) {
result = (pipe_cmd | getline);
if (result < 0) {
print "Pipe error: " pipe_cmd " " ERRNO > "/dev/stderr";
}
} else {
result = (getline < filename);
if (result < 0) {
print "Read file error: " filename " " ERRNO > "/dev/stderr";
}
}
return result;
}
function closeline() {
if (use_zcat || use_bzcat) {
return close(pipe_cmd);
} else {
return close(filename);
}
}
function do_one() {
insh = 0; thisjoin = 1; done = 0;
entire_line = "";
if (verbose) {
print "adding " filename > "/dev/stderr"
}
use_zcat = match(filename,"\\.Z$") ||
match(filename,"\\.z$") || match(filename,"\\.gz$");
if (!use_zcat)
use_bzcat = match(filename,"\\.bz2");
if (use_zcat || use_bzcat) {
filename_no_gz = substr(filename, 0, RSTART - 1);
} else {
filename_no_gz = filename;
}
match(filename_no_gz, "/[^/]+$");
progname = substr(filename, RSTART + 1, RLENGTH - 1);
if (match(progname, "\\." section "[A-Za-z]+")) {
actual_section = substr(progname, RSTART + 1, RLENGTH - 1);
} else {
actual_section = section;
}
sub(/\..*/, "", progname);
if (use_zcat || use_bzcat) {
if (use_zcat) {
pipe_cmd = "zcat \"" filename "\"";
} else {
pipe_cmd = "bzcat \"" filename "\"";
}
# try to avoid suspicious stuff
if (filename ~ /[;&|`$(]/) {
print "ignored strange file name " filename " in " curdir > "/dev/stderr";
return;
}
}
while (!done && readline() > 0) {
gsub(/.\b/, "");
if (($1 ~ /^\.[Ss][Hh]/ &&
($2 ~ /[Nn][Aa][Mm][Ee]/ ||
$2 ~ /^JMÉNO/ || $2 ~ /^NAVN/ || $2 ~ /^NUME/ ||
$2 ~ /^BEZEICHNUNG/ || $2 ~ /^NOMBRE/ ||
$2 ~ /^NIMI/ || $2 ~ /^NOM/ || $2 ~ /^IME/ ||
$2 ~ /^N[ÉE]V/ || $2 ~ /^NAMA/ || $2 ~ /^̾Á°/ ||
$2 ~ /^̾¾Î/ || $2 ~ /^À̸§/ || $2 ~ /^NAZWA/ ||
$2 ~ /^îáú÷áîéå/ || $2 ~ /^Ãû³Æ/ || $2 ~ /^¦WºÙ/ ||
$2 ~ /^NOME/ || $2 ~ /^NAAM/) || $2 ~ /^ÈÌÅ/)) ||
(pages == "cat" && $1 ~ /^NAME/)) {
if (!insh) {
insh = 1;
} else {
done = 1;
}
} else if (insh) {
if ($1 ~ /^\.[Ss][HhYS]/ ||
(pages == "cat" &&
($1 ~ /^S[yYeE]/ || $1 ~ /^DESCRIPTION/ ||
$1 ~ /^COMMAND/ || $1 ~ /^OVERVIEW/ ||
$1 ~ /^STRUCTURES/ || $1 ~ /^INTRODUCTION/ ||
$0 ~ /^[^ ]/))) {
# end insh for Synopsis, Syntax, but also for
# DESCRIPTION (e.g., XFree86.1x),
# COMMAND (e.g., xspread.1)
# OVERVIEW (e.g., TclCommandWriting.3)
# STRUCTURES (e.g., XEvent.3x)
# INTRODUCTION (e.g., TclX.n)
# and anything at all that begins in Column 1, so
# is probably a section header.
done = 1;
} else {
if ($0 ~ progname"-") { # Fix old cat pages
sub(progname"-", progname" - ");
}
if ($0 ~ /[^ \\]-$/) {
sub(/-$/, ""); # Handle Hyphenations
nextjoin = 1;
} else if ($0 ~ /\\c$/) {
sub(/\\c$/, ""); # Handle Continuations
nextjoin = 1;
} else
nextjoin = 0;
sub(/^.[IB] /, ""); # Kill bold and italics
sub(/^.BI /, ""); #
sub(/^.SM /, ""); # Kill small
sub(/^.Nm /, ""); # Kill bold
sub(/^.Tn /, ""); # Kill normal
sub(/^.Li /, ""); # Kill .Li
sub(/^.Dq /, ""); # Kill .Dq
sub(/^.Nd */, "- "); # Convert .Nd to dash
sub(/\\\".*/, ""); # Trim pending comments
sub(/ *$/, ""); # Trim pending spaces
sub(/^\.$/, ""); # Kill blank comments
sub(/^'.*/, ""); # Kill comment/troff lines
sub(/^.in .*/, ""); # Kill various macros
sub(/^.ti .*/, "");
sub(/^.ta .*/, "");
sub(/^.Vb .*/, "");
sub(/^.[PLTH]P$/, ""); # .PP/.LP/.TP/.HP
sub(/^.Pp$/, "");
sub(/^.[iI]X .*$/, "");
sub(/^.nolinks$/, "");
sub(/^.B$/, "");
sub(/^.nf$/, "");
if (($1 ~ /^\.../ || $1 == "") &&
(entire_line ~ / - / || entire_line ~ / \\- /)) {
# Assume that this ends the description of one line
# Sometimes there are several descriptions in one page,
# as in outb(2).
handle_entire_line();
entire_line = "";
thisjoin = 1;
} else {
if (thisjoin) {
entire_line = entire_line $0;
} else {
entire_line = entire_line " " $0;
}
thisjoin = nextjoin;
}
}
}
}
handle_entire_line();
closeline();
}
function handle_entire_line() {
x = entire_line; # Keep it short
gsub(/\015/, "", x); # Kill DOS remains
gsub(/ /, " ", x); # Translate tabs to spaces
gsub(/ +/, " ", x); # Collapse spaces
gsub(/ *, */, ", ", x); # Fix comma spacings
sub(/^ /, "", x); # Kill initial spaces
sub(/ $/, "", x); # Kill trailing spaces
sub(/__+/, "_", x); # Collapse underscores
gsub(/\\f\(../, "", x); # Kill font changes
gsub(/\\f[PRIB0123]/, "", x); # Kill font changes
gsub(/\\s[-+0-9]*/, "", x); # Kill size changes
gsub(/\\&/, "", x); # Kill \&
gsub(/\\\|/, "", x); # Kill \|
gsub(/\\\((ru|ul)/, "_", x); # Translate
gsub(/\\\((mi|hy|em)/, "-", x); # Translate
gsub(/\\\*\(../, "", x); # Kill troff strings
gsub(/\\/, "", x); # Kill all backslashes
gsub(/"/, "", x); # Kill quotes (from .Nd "foo bar")
sub(/<h1 align=center>/, "", x);# Yuk! HTML cruft
gsub(/\000.*/, "X", x); # Binary cruft in LAPACK pages
gsub(/ +/, " ", x); # Collapse spaces (again)
sub(/^ /, "", x); # Kill initial spaces (again)
sub(/ $/, "", x); # Kill trailing spaces (again)
sub(/\.$/, "", x); # Kill trailing period
if (!match(x, / - /))
return;
after_dash = substr(x, RSTART);
head = substr(x, 1, RSTART-1) ", ";
while (match(head, /, /)) {
prog = substr(head, 1, RSTART-1);
head = substr(head, RSTART+2);
if (prog != progname)
prog = prog " [" progname "]";
printf "%-*s (%s) %s\n", 20, prog, actual_section, after_dash;
}
}
{ # Main action - process each filename read in.
filename = $0;
do_one();
}
pages=man section=2 verbose= curdir=/usr/local/share/man/man2
awk: line 74: syntax error at or near ||
awk: line 75: extra ')'
awk: line 78: syntax error at or near else
awk: line 81: syntax error at or near }
awk: line 151: syntax error at or near }
+ cd ..
+ [ -d man3 ]
+ cd man3
+ section=3
+ curdir=/usr/local/share/man/man3
+ export section verbose curdir
+ find /usr/local/share/man/man3/. -name * -type f -size +0 -ctime 0 -print
+ /bin/awk
function readline() {
if (use_zcat || use_bzcat) {
result = (pipe_cmd | getline);
if (result < 0) {
print "Pipe error: " pipe_cmd " " ERRNO > "/dev/stderr";
}
} else {
result = (getline < filename);
if (result < 0) {
print "Read file error: " filename " " ERRNO > "/dev/stderr";
}
}
return result;
}
function closeline() {
if (use_zcat || use_bzcat) {
return close(pipe_cmd);
} else {
return close(filename);
}
}
function do_one() {
insh = 0; thisjoin = 1; done = 0;
entire_line = "";
if (verbose) {
print "adding " filename > "/dev/stderr"
}
use_zcat = match(filename,"\\.Z$") ||
match(filename,"\\.z$") || match(filename,"\\.gz$");
if (!use_zcat)
use_bzcat = match(filename,"\\.bz2");
if (use_zcat || use_bzcat) {
filename_no_gz = substr(filename, 0, RSTART - 1);
} else {
filename_no_gz = filename;
}
match(filename_no_gz, "/[^/]+$");
progname = substr(filename, RSTART + 1, RLENGTH - 1);
if (match(progname, "\\." section "[A-Za-z]+")) {
actual_section = substr(progname, RSTART + 1, RLENGTH - 1);
} else {
actual_section = section;
}
sub(/\..*/, "", progname);
if (use_zcat || use_bzcat) {
if (use_zcat) {
pipe_cmd = "zcat \"" filename "\"";
} else {
pipe_cmd = "bzcat \"" filename "\"";
}
# try to avoid suspicious stuff
if (filename ~ /[;&|`$(]/) {
print "ignored strange file name " filename " in " curdir > "/dev/stderr";
return;
}
}
while (!done && readline() > 0) {
gsub(/.\b/, "");
if (($1 ~ /^\.[Ss][Hh]/ &&
($2 ~ /[Nn][Aa][Mm][Ee]/ ||
$2 ~ /^JMÉNO/ || $2 ~ /^NAVN/ || $2 ~ /^NUME/ ||
$2 ~ /^BEZEICHNUNG/ || $2 ~ /^NOMBRE/ ||
$2 ~ /^NIMI/ || $2 ~ /^NOM/ || $2 ~ /^IME/ ||
$2 ~ /^N[ÉE]V/ || $2 ~ /^NAMA/ || $2 ~ /^̾Á°/ ||
$2 ~ /^̾¾Î/ || $2 ~ /^À̸§/ || $2 ~ /^NAZWA/ ||
$2 ~ /^îáú÷áîéå/ || $2 ~ /^Ãû³Æ/ || $2 ~ /^¦WºÙ/ ||
$2 ~ /^NOME/ || $2 ~ /^NAAM/) || $2 ~ /^ÈÌÅ/)) ||
(pages == "cat" && $1 ~ /^NAME/)) {
if (!insh) {
insh = 1;
} else {
done = 1;
}
} else if (insh) {
if ($1 ~ /^\.[Ss][HhYS]/ ||
(pages == "cat" &&
($1 ~ /^S[yYeE]/ || $1 ~ /^DESCRIPTION/ ||
$1 ~ /^COMMAND/ || $1 ~ /^OVERVIEW/ ||
$1 ~ /^STRUCTURES/ || $1 ~ /^INTRODUCTION/ ||
$0 ~ /^[^ ]/))) {
# end insh for Synopsis, Syntax, but also for
# DESCRIPTION (e.g., XFree86.1x),
# COMMAND (e.g., xspread.1)
# OVERVIEW (e.g., TclCommandWriting.3)
# STRUCTURES (e.g., XEvent.3x)
# INTRODUCTION (e.g., TclX.n)
# and anything at all that begins in Column 1, so
# is probably a section header.
done = 1;
} else {
if ($0 ~ progname"-") { # Fix old cat pages
sub(progname"-", progname" - ");
}
if ($0 ~ /[^ \\]-$/) {
sub(/-$/, ""); # Handle Hyphenations
nextjoin = 1;
} else if ($0 ~ /\\c$/) {
sub(/\\c$/, ""); # Handle Continuations
nextjoin = 1;
} else
nextjoin = 0;
sub(/^.[IB] /, ""); # Kill bold and italics
sub(/^.BI /, ""); #
sub(/^.SM /, ""); # Kill small
sub(/^.Nm /, ""); # Kill bold
sub(/^.Tn /, ""); # Kill normal
sub(/^.Li /, ""); # Kill .Li
sub(/^.Dq /, ""); # Kill .Dq
sub(/^.Nd */, "- "); # Convert .Nd to dash
sub(/\\\".*/, ""); # Trim pending comments
sub(/ *$/, ""); # Trim pending spaces
sub(/^\.$/, ""); # Kill blank comments
sub(/^'.*/, ""); # Kill comment/troff lines
sub(/^.in .*/, ""); # Kill various macros
sub(/^.ti .*/, "");
sub(/^.ta .*/, "");
sub(/^.Vb .*/, "");
sub(/^.[PLTH]P$/, ""); # .PP/.LP/.TP/.HP
sub(/^.Pp$/, "");
sub(/^.[iI]X .*$/, "");
sub(/^.nolinks$/, "");
sub(/^.B$/, "");
sub(/^.nf$/, "");
if (($1 ~ /^\.../ || $1 == "") &&
(entire_line ~ / - / || entire_line ~ / \\- /)) {
# Assume that this ends the description of one line
# Sometimes there are several descriptions in one page,
# as in outb(2).
handle_entire_line();
entire_line = "";
thisjoin = 1;
} else {
if (thisjoin) {
entire_line = entire_line $0;
} else {
entire_line = entire_line " " $0;
}
thisjoin = nextjoin;
}
}
}
}
handle_entire_line();
closeline();
}
function handle_entire_line() {
x = entire_line; # Keep it short
gsub(/\015/, "", x); # Kill DOS remains
gsub(/ /, " ", x); # Translate tabs to spaces
gsub(/ +/, " ", x); # Collapse spaces
gsub(/ *, */, ", ", x); # Fix comma spacings
sub(/^ /, "", x); # Kill initial spaces
sub(/ $/, "", x); # Kill trailing spaces
sub(/__+/, "_", x); # Collapse underscores
gsub(/\\f\(../, "", x); # Kill font changes
gsub(/\\f[PRIB0123]/, "", x); # Kill font changes
gsub(/\\s[-+0-9]*/, "", x); # Kill size changes
gsub(/\\&/, "", x); # Kill \&
gsub(/\\\|/, "", x); # Kill \|
gsub(/\\\((ru|ul)/, "_", x); # Translate
gsub(/\\\((mi|hy|em)/, "-", x); # Translate
gsub(/\\\*\(../, "", x); # Kill troff strings
gsub(/\\/, "", x); # Kill all backslashes
gsub(/"/, "", x); # Kill quotes (from .Nd "foo bar")
sub(/<h1 align=center>/, "", x);# Yuk! HTML cruft
gsub(/\000.*/, "X", x); # Binary cruft in LAPACK pages
gsub(/ +/, " ", x); # Collapse spaces (again)
sub(/^ /, "", x); # Kill initial spaces (again)
sub(/ $/, "", x); # Kill trailing spaces (again)
sub(/\.$/, "", x); # Kill trailing period
if (!match(x, / - /))
return;
after_dash = substr(x, RSTART);
head = substr(x, 1, RSTART-1) ", ";
while (match(head, /, /)) {
prog = substr(head, 1, RSTART-1);
head = substr(head, RSTART+2);
if (prog != progname)
prog = prog " [" progname "]";
printf "%-*s (%s) %s\n", 20, prog, actual_section, after_dash;
}
}
{ # Main action - process each filename read in.
filename = $0;
do_one();
}
pages=man section=3 verbose= curdir=/usr/local/share/man/man3
awk: line 74: syntax error at or near ||
awk: line 75: extra ')'
awk: line 78: syntax error at or near else
awk: line 81: syntax error at or near }
awk: line 151: syntax error at or near }
+ cd ..
+ [ -d man4 ]
+ cd man4
+ section=4
+ curdir=/usr/local/share/man/man4
+ export section verbose curdir
+ find /usr/local/share/man/man4/. -name * -type f -size +0 -ctime 0 -print
+ /bin/awk
function readline() {
if (use_zcat || use_bzcat) {
result = (pipe_cmd | getline);
if (result < 0) {
print "Pipe error: " pipe_cmd " " ERRNO > "/dev/stderr";
}
} else {
result = (getline < filename);
if (result < 0) {
print "Read file error: " filename " " ERRNO > "/dev/stderr";
}
}
return result;
}
function closeline() {
if (use_zcat || use_bzcat) {
return close(pipe_cmd);
} else {
return close(filename);
}
}
function do_one() {
insh = 0; thisjoin = 1; done = 0;
entire_line = "";
if (verbose) {
print "adding " filename > "/dev/stderr"
}
use_zcat = match(filename,"\\.Z$") ||
match(filename,"\\.z$") || match(filename,"\\.gz$");
if (!use_zcat)
use_bzcat = match(filename,"\\.bz2");
if (use_zcat || use_bzcat) {
filename_no_gz = substr(filename, 0, RSTART - 1);
} else {
filename_no_gz = filename;
}
match(filename_no_gz, "/[^/]+$");
progname = substr(filename, RSTART + 1, RLENGTH - 1);
if (match(progname, "\\." section "[A-Za-z]+")) {
actual_section = substr(progname, RSTART + 1, RLENGTH - 1);
} else {
actual_section = section;
}
sub(/\..*/, "", progname);
if (use_zcat || use_bzcat) {
if (use_zcat) {
pipe_cmd = "zcat \"" filename "\"";
} else {
pipe_cmd = "bzcat \"" filename "\"";
}
# try to avoid suspicious stuff
if (filename ~ /[;&|`$(]/) {
print "ignored strange file name " filename " in " curdir > "/dev/stderr";
return;
}
}
while (!done && readline() > 0) {
gsub(/.\b/, "");
if (($1 ~ /^\.[Ss][Hh]/ &&
($2 ~ /[Nn][Aa][Mm][Ee]/ ||
$2 ~ /^JMÉNO/ || $2 ~ /^NAVN/ || $2 ~ /^NUME/ ||
$2 ~ /^BEZEICHNUNG/ || $2 ~ /^NOMBRE/ ||
$2 ~ /^NIMI/ || $2 ~ /^NOM/ || $2 ~ /^IME/ ||
$2 ~ /^N[ÉE]V/ || $2 ~ /^NAMA/ || $2 ~ /^̾Á°/ ||
$2 ~ /^̾¾Î/ || $2 ~ /^À̸§/ || $2 ~ /^NAZWA/ ||
$2 ~ /^îáú÷áîéå/ || $2 ~ /^Ãû³Æ/ || $2 ~ /^¦WºÙ/ ||
$2 ~ /^NOME/ || $2 ~ /^NAAM/) || $2 ~ /^ÈÌÅ/)) ||
(pages == "cat" && $1 ~ /^NAME/)) {
if (!insh) {
insh = 1;
} else {
done = 1;
}
} else if (insh) {
if ($1 ~ /^\.[Ss][HhYS]/ ||
(pages == "cat" &&
($1 ~ /^S[yYeE]/ || $1 ~ /^DESCRIPTION/ ||
$1 ~ /^COMMAND/ || $1 ~ /^OVERVIEW/ ||
$1 ~ /^STRUCTURES/ || $1 ~ /^INTRODUCTION/ ||
$0 ~ /^[^ ]/))) {
# end insh for Synopsis, Syntax, but also for
# DESCRIPTION (e.g., XFree86.1x),
# COMMAND (e.g., xspread.1)
# OVERVIEW (e.g., TclCommandWriting.3)
# STRUCTURES (e.g., XEvent.3x)
# INTRODUCTION (e.g., TclX.n)
# and anything at all that begins in Column 1, so
# is probably a section header.
done = 1;
} else {
if ($0 ~ progname"-") { # Fix old cat pages
sub(progname"-", progname" - ");
}
if ($0 ~ /[^ \\]-$/) {
sub(/-$/, ""); # Handle Hyphenations
nextjoin = 1;
} else if ($0 ~ /\\c$/) {
sub(/\\c$/, ""); # Handle Continuations
nextjoin = 1;
} else
nextjoin = 0;
sub(/^.[IB] /, ""); # Kill bold and italics
sub(/^.BI /, ""); #
sub(/^.SM /, ""); # Kill small
sub(/^.Nm /, ""); # Kill bold
sub(/^.Tn /, ""); # Kill normal
sub(/^.Li /, ""); # Kill .Li
sub(/^.Dq /, ""); # Kill .Dq
sub(/^.Nd */, "- "); # Convert .Nd to dash
sub(/\\\".*/, ""); # Trim pending comments
sub(/ *$/, ""); # Trim pending spaces
sub(/^\.$/, ""); # Kill blank comments
sub(/^'.*/, ""); # Kill comment/troff lines
sub(/^.in .*/, ""); # Kill various macros
sub(/^.ti .*/, "");
sub(/^.ta .*/, "");
sub(/^.Vb .*/, "");
sub(/^.[PLTH]P$/, ""); # .PP/.LP/.TP/.HP
sub(/^.Pp$/, "");
sub(/^.[iI]X .*$/, "");
sub(/^.nolinks$/, "");
sub(/^.B$/, "");
sub(/^.nf$/, "");
if (($1 ~ /^\.../ || $1 == "") &&
(entire_line ~ / - / || entire_line ~ / \\- /)) {
# Assume that this ends the description of one line
# Sometimes there are several descriptions in one page,
# as in outb(2).
handle_entire_line();
entire_line = "";
thisjoin = 1;
} else {
if (thisjoin) {
entire_line = entire_line $0;
} else {
entire_line = entire_line " " $0;
}
thisjoin = nextjoin;
}
}
}
}
handle_entire_line();
closeline();
}
function handle_entire_line() {
x = entire_line; # Keep it short
gsub(/\015/, "", x); # Kill DOS remains
gsub(/ /, " ", x); # Translate tabs to spaces
gsub(/ +/, " ", x); # Collapse spaces
gsub(/ *, */, ", ", x); # Fix comma spacings
sub(/^ /, "", x); # Kill initial spaces
sub(/ $/, "", x); # Kill trailing spaces
sub(/__+/, "_", x); # Collapse underscores
gsub(/\\f\(../, "", x); # Kill font changes
gsub(/\\f[PRIB0123]/, "", x); # Kill font changes
gsub(/\\s[-+0-9]*/, "", x); # Kill size changes
gsub(/\\&/, "", x); # Kill \&
gsub(/\\\|/, "", x); # Kill \|
gsub(/\\\((ru|ul)/, "_", x); # Translate
gsub(/\\\((mi|hy|em)/, "-", x); # Translate
gsub(/\\\*\(../, "", x); # Kill troff strings
gsub(/\\/, "", x); # Kill all backslashes
gsub(/"/, "", x); # Kill quotes (from .Nd "foo bar")
sub(/<h1 align=center>/, "", x);# Yuk! HTML cruft
gsub(/\000.*/, "X", x); # Binary cruft in LAPACK pages
gsub(/ +/, " ", x); # Collapse spaces (again)
sub(/^ /, "", x); # Kill initial spaces (again)
sub(/ $/, "", x); # Kill trailing spaces (again)
sub(/\.$/, "", x); # Kill trailing period
if (!match(x, / - /))
return;
after_dash = substr(x, RSTART);
head = substr(x, 1, RSTART-1) ", ";
while (match(head, /, /)) {
prog = substr(head, 1, RSTART-1);
head = substr(head, RSTART+2);
if (prog != progname)
prog = prog " [" progname "]";
printf "%-*s (%s) %s\n", 20, prog, actual_section, after_dash;
}
}
{ # Main action - process each filename read in.
filename = $0;
do_one();
}
pages=man section=4 verbose= curdir=/usr/local/share/man/man4
awk: line 74: syntax error at or near ||
awk: line 75: extra ')'
awk: line 78: syntax error at or near else
awk: line 81: syntax error at or near }
awk: line 151: syntax error at or near }
+ cd ..
+ [ -d man5 ]
+ cd man5
+ section=5
+ curdir=/usr/local/share/man/man5
+ export section verbose curdir
+ find /usr/local/share/man/man5/. -name * -type f -size +0 -ctime 0 -print
+ /bin/awk
function readline() {
if (use_zcat || use_bzcat) {
result = (pipe_cmd | getline);
if (result < 0) {
print "Pipe error: " pipe_cmd " " ERRNO > "/dev/stderr";
}
} else {
result = (getline < filename);
if (result < 0) {
print "Read file error: " filename " " ERRNO > "/dev/stderr";
}
}
return result;
}
function closeline() {
if (use_zcat || use_bzcat) {
return close(pipe_cmd);
} else {
return close(filename);
}
}
function do_one() {
insh = 0; thisjoin = 1; done = 0;
entire_line = "";
if (verbose) {
print "adding " filename > "/dev/stderr"
}
use_zcat = match(filename,"\\.Z$") ||
match(filename,"\\.z$") || match(filename,"\\.gz$");
if (!use_zcat)
use_bzcat = match(filename,"\\.bz2");
if (use_zcat || use_bzcat) {
filename_no_gz = substr(filename, 0, RSTART - 1);
} else {
filename_no_gz = filename;
}
match(filename_no_gz, "/[^/]+$");
progname = substr(filename, RSTART + 1, RLENGTH - 1);
if (match(progname, "\\." section "[A-Za-z]+")) {
actual_section = substr(progname, RSTART + 1, RLENGTH - 1);
} else {
actual_section = section;
}
sub(/\..*/, "", progname);
if (use_zcat || use_bzcat) {
if (use_zcat) {
pipe_cmd = "zcat \"" filename "\"";
} else {
pipe_cmd = "bzcat \"" filename "\"";
}
# try to avoid suspicious stuff
if (filename ~ /[;&|`$(]/) {
print "ignored strange file name " filename " in " curdir > "/dev/stderr";
return;
}
}
while (!done && readline() > 0) {
gsub(/.\b/, "");
if (($1 ~ /^\.[Ss][Hh]/ &&
($2 ~ /[Nn][Aa][Mm][Ee]/ ||
$2 ~ /^JMÉNO/ || $2 ~ /^NAVN/ || $2 ~ /^NUME/ ||
$2 ~ /^BEZEICHNUNG/ || $2 ~ /^NOMBRE/ ||
$2 ~ /^NIMI/ || $2 ~ /^NOM/ || $2 ~ /^IME/ ||
$2 ~ /^N[ÉE]V/ || $2 ~ /^NAMA/ || $2 ~ /^̾Á°/ ||
$2 ~ /^̾¾Î/ || $2 ~ /^À̸§/ || $2 ~ /^NAZWA/ ||
$2 ~ /^îáú÷áîéå/ || $2 ~ /^Ãû³Æ/ || $2 ~ /^¦WºÙ/ ||
$2 ~ /^NOME/ || $2 ~ /^NAAM/) || $2 ~ /^ÈÌÅ/)) ||
(pages == "cat" && $1 ~ /^NAME/)) {
if (!insh) {
insh = 1;
} else {
done = 1;
}
} else if (insh) {
if ($1 ~ /^\.[Ss][HhYS]/ ||
(pages == "cat" &&
($1 ~ /^S[yYeE]/ || $1 ~ /^DESCRIPTION/ ||
$1 ~ /^COMMAND/ || $1 ~ /^OVERVIEW/ ||
$1 ~ /^STRUCTURES/ || $1 ~ /^INTRODUCTION/ ||
$0 ~ /^[^ ]/))) {
# end insh for Synopsis, Syntax, but also for
# DESCRIPTION (e.g., XFree86.1x),
# COMMAND (e.g., xspread.1)
# OVERVIEW (e.g., TclCommandWriting.3)
# STRUCTURES (e.g., XEvent.3x)
# INTRODUCTION (e.g., TclX.n)
# and anything at all that begins in Column 1, so
# is probably a section header.
done = 1;
} else {
if ($0 ~ progname"-") { # Fix old cat pages
sub(progname"-", progname" - ");
}
if ($0 ~ /[^ \\]-$/) {
sub(/-$/, ""); # Handle Hyphenations
nextjoin = 1;
} else if ($0 ~ /\\c$/) {
sub(/\\c$/, ""); # Handle Continuations
nextjoin = 1;
} else
nextjoin = 0;
sub(/^.[IB] /, ""); # Kill bold and italics
sub(/^.BI /, ""); #
sub(/^.SM /, ""); # Kill small
sub(/^.Nm /, ""); # Kill bold
sub(/^.Tn /, ""); # Kill normal
sub(/^.Li /, ""); # Kill .Li
sub(/^.Dq /, ""); # Kill .Dq
sub(/^.Nd */, "- "); # Convert .Nd to dash
sub(/\\\".*/, ""); # Trim pending comments
sub(/ *$/, ""); # Trim pending spaces
sub(/^\.$/, ""); # Kill blank comments
sub(/^'.*/, ""); # Kill comment/troff lines
sub(/^.in .*/, ""); # Kill various macros
sub(/^.ti .*/, "");
sub(/^.ta .*/, "");
sub(/^.Vb .*/, "");
sub(/^.[PLTH]P$/, ""); # .PP/.LP/.TP/.HP
sub(/^.Pp$/, "");
sub(/^.[iI]X .*$/, "");
sub(/^.nolinks$/, "");
sub(/^.B$/, "");
sub(/^.nf$/, "");
if (($1 ~ /^\.../ || $1 == "") &&
(entire_line ~ / - / || entire_line ~ / \\- /)) {
# Assume that this ends the description of one line
# Sometimes there are several descriptions in one page,
# as in outb(2).
handle_entire_line();
entire_line = "";
thisjoin = 1;
} else {
if (thisjoin) {
entire_line = entire_line $0;
} else {
entire_line = entire_line " " $0;
}
thisjoin = nextjoin;
}
}
}
}
handle_entire_line();
closeline();
}
function handle_entire_line() {
x = entire_line; # Keep it short
gsub(/\015/, "", x); # Kill DOS remains
gsub(/ /, " ", x); # Translate tabs to spaces
gsub(/ +/, " ", x); # Collapse spaces
gsub(/ *, */, ", ", x); # Fix comma spacings
sub(/^ /, "", x); # Kill initial spaces
sub(/ $/, "", x); # Kill trailing spaces
sub(/__+/, "_", x); # Collapse underscores
gsub(/\\f\(../, "", x); # Kill font changes
gsub(/\\f[PRIB0123]/, "", x); # Kill font changes
gsub(/\\s[-+0-9]*/, "", x); # Kill size changes
gsub(/\\&/, "", x); # Kill \&
gsub(/\\\|/, "", x); # Kill \|
gsub(/\\\((ru|ul)/, "_", x); # Translate
gsub(/\\\((mi|hy|em)/, "-", x); # Translate
gsub(/\\\*\(../, "", x); # Kill troff strings
gsub(/\\/, "", x); # Kill all backslashes
gsub(/"/, "", x); # Kill quotes (from .Nd "foo bar")
sub(/<h1 align=center>/, "", x);# Yuk! HTML cruft
gsub(/\000.*/, "X", x); # Binary cruft in LAPACK pages
gsub(/ +/, " ", x); # Collapse spaces (again)
sub(/^ /, "", x); # Kill initial spaces (again)
sub(/ $/, "", x); # Kill trailing spaces (again)
sub(/\.$/, "", x); # Kill trailing period
if (!match(x, / - /))
return;
after_dash = substr(x, RSTART);
head = substr(x, 1, RSTART-1) ", ";
while (match(head, /, /)) {
prog = substr(head, 1, RSTART-1);
head = substr(head, RSTART+2);
if (prog != progname)
prog = prog " [" progname "]";
printf "%-*s (%s) %s\n", 20, prog, actual_section, after_dash;
}
}
{ # Main action - process each filename read in.
filename = $0;
do_one();
}
pages=man section=5 verbose= curdir=/usr/local/share/man/man5
awk: line 74: syntax error at or near ||
awk: line 75: extra ')'
awk: line 78: syntax error at or near else
awk: line 81: syntax error at or near }
awk: line 151: syntax error at or near }
+ cd ..
+ [ -d man6 ]
+ cd man6
+ section=6
+ curdir=/usr/local/share/man/man6
+ export section verbose curdir
+ find /usr/local/share/man/man6/. -name * -type f -size +0 -ctime 0 -print
+ /bin/awk
function readline() {
if (use_zcat || use_bzcat) {
result = (pipe_cmd | getline);
if (result < 0) {
print "Pipe error: " pipe_cmd " " ERRNO > "/dev/stderr";
}
} else {
result = (getline < filename);
if (result < 0) {
print "Read file error: " filename " " ERRNO > "/dev/stderr";
}
}
return result;
}
function closeline() {
if (use_zcat || use_bzcat) {
return close(pipe_cmd);
} else {
return close(filename);
}
}
function do_one() {
insh = 0; thisjoin = 1; done = 0;
entire_line = "";
if (verbose) {
print "adding " filename > "/dev/stderr"
}
use_zcat = match(filename,"\\.Z$") ||
match(filename,"\\.z$") || match(filename,"\\.gz$");
if (!use_zcat)
use_bzcat = match(filename,"\\.bz2");
if (use_zcat || use_bzcat) {
filename_no_gz = substr(filename, 0, RSTART - 1);
} else {
filename_no_gz = filename;
}
match(filename_no_gz, "/[^/]+$");
progname = substr(filename, RSTART + 1, RLENGTH - 1);
if (match(progname, "\\." section "[A-Za-z]+")) {
actual_section = substr(progname, RSTART + 1, RLENGTH - 1);
} else {
actual_section = section;
}
sub(/\..*/, "", progname);
if (use_zcat || use_bzcat) {
if (use_zcat) {
pipe_cmd = "zcat \"" filename "\"";
} else {
pipe_cmd = "bzcat \"" filename "\"";
}
# try to avoid suspicious stuff
if (filename ~ /[;&|`$(]/) {
print "ignored strange file name " filename " in " curdir > "/dev/stderr";
return;
}
}
while (!done && readline() > 0) {
gsub(/.\b/, "");
if (($1 ~ /^\.[Ss][Hh]/ &&
($2 ~ /[Nn][Aa][Mm][Ee]/ ||
$2 ~ /^JMÉNO/ || $2 ~ /^NAVN/ || $2 ~ /^NUME/ ||
$2 ~ /^BEZEICHNUNG/ || $2 ~ /^NOMBRE/ ||
$2 ~ /^NIMI/ || $2 ~ /^NOM/ || $2 ~ /^IME/ ||
$2 ~ /^N[ÉE]V/ || $2 ~ /^NAMA/ || $2 ~ /^̾Á°/ ||
$2 ~ /^̾¾Î/ || $2 ~ /^À̸§/ || $2 ~ /^NAZWA/ ||
$2 ~ /^îáú÷áîéå/ || $2 ~ /^Ãû³Æ/ || $2 ~ /^¦WºÙ/ ||
$2 ~ /^NOME/ || $2 ~ /^NAAM/) || $2 ~ /^ÈÌÅ/)) ||
(pages == "cat" && $1 ~ /^NAME/)) {
if (!insh) {
insh = 1;
} else {
done = 1;
}
} else if (insh) {
if ($1 ~ /^\.[Ss][HhYS]/ ||
(pages == "cat" &&
($1 ~ /^S[yYeE]/ || $1 ~ /^DESCRIPTION/ ||
$1 ~ /^COMMAND/ || $1 ~ /^OVERVIEW/ ||
$1 ~ /^STRUCTURES/ || $1 ~ /^INTRODUCTION/ ||
$0 ~ /^[^ ]/))) {
# end insh for Synopsis, Syntax, but also for
# DESCRIPTION (e.g., XFree86.1x),
# COMMAND (e.g., xspread.1)
# OVERVIEW (e.g., TclCommandWriting.3)
# STRUCTURES (e.g., XEvent.3x)
# INTRODUCTION (e.g., TclX.n)
# and anything at all that begins in Column 1, so
# is probably a section header.
done = 1;
} else {
if ($0 ~ progname"-") { # Fix old cat pages
sub(progname"-", progname" - ");
}
if ($0 ~ /[^ \\]-$/) {
sub(/-$/, ""); # Handle Hyphenations
nextjoin = 1;
} else if ($0 ~ /\\c$/) {
sub(/\\c$/, ""); # Handle Continuations
nextjoin = 1;
} else
nextjoin = 0;
sub(/^.[IB] /, ""); # Kill bold and italics
sub(/^.BI /, ""); #
sub(/^.SM /, ""); # Kill small
sub(/^.Nm /, ""); # Kill bold
sub(/^.Tn /, ""); # Kill normal
sub(/^.Li /, ""); # Kill .Li
sub(/^.Dq /, ""); # Kill .Dq
sub(/^.Nd */, "- "); # Convert .Nd to dash
sub(/\\\".*/, ""); # Trim pending comments
sub(/ *$/, ""); # Trim pending spaces
sub(/^\.$/, ""); # Kill blank comments
sub(/^'.*/, ""); # Kill comment/troff lines
sub(/^.in .*/, ""); # Kill various macros
sub(/^.ti .*/, "");
sub(/^.ta .*/, "");
sub(/^.Vb .*/, "");
sub(/^.[PLTH]P$/, ""); # .PP/.LP/.TP/.HP
sub(/^.Pp$/, "");
sub(/^.[iI]X .*$/, "");
sub(/^.nolinks$/, "");
sub(/^.B$/, "");
sub(/^.nf$/, "");
if (($1 ~ /^\.../ || $1 == "") &&
(entire_line ~ / - / || entire_line ~ / \\- /)) {
# Assume that this ends the description of one line
# Sometimes there are several descriptions in one page,
# as in outb(2).
handle_entire_line();
entire_line = "";
thisjoin = 1;
} else {
if (thisjoin) {
entire_line = entire_line $0;
} else {
entire_line = entire_line " " $0;
}
thisjoin = nextjoin;
}
}
}
}
handle_entire_line();
closeline();
}
function handle_entire_line() {
x = entire_line; # Keep it short
gsub(/\015/, "", x); # Kill DOS remains
gsub(/ /, " ", x); # Translate tabs to spaces
gsub(/ +/, " ", x); # Collapse spaces
gsub(/ *, */, ", ", x); # Fix comma spacings
sub(/^ /, "", x); # Kill initial spaces
sub(/ $/, "", x); # Kill trailing spaces
sub(/__+/, "_", x); # Collapse underscores
gsub(/\\f\(../, "", x); # Kill font changes
gsub(/\\f[PRIB0123]/, "", x); # Kill font changes
gsub(/\\s[-+0-9]*/, "", x); # Kill size changes
gsub(/\\&/, "", x); # Kill \&
gsub(/\\\|/, "", x); # Kill \|
gsub(/\\\((ru|ul)/, "_", x); # Translate
gsub(/\\\((mi|hy|em)/, "-", x); # Translate
gsub(/\\\*\(../, "", x); # Kill troff strings
gsub(/\\/, "", x); # Kill all backslashes
gsub(/"/, "", x); # Kill quotes (from .Nd "foo bar")
sub(/<h1 align=center>/, "", x);# Yuk! HTML cruft
gsub(/\000.*/, "X", x); # Binary cruft in LAPACK pages
gsub(/ +/, " ", x); # Collapse spaces (again)
sub(/^ /, "", x); # Kill initial spaces (again)
sub(/ $/, "", x); # Kill trailing spaces (again)
sub(/\.$/, "", x); # Kill trailing period
if (!match(x, / - /))
return;
after_dash = substr(x, RSTART);
head = substr(x, 1, RSTART-1) ", ";
while (match(head, /, /)) {
prog = substr(head, 1, RSTART-1);
head = substr(head, RSTART+2);
if (prog != progname)
prog = prog " [" progname "]";
printf "%-*s (%s) %s\n", 20, prog, actual_section, after_dash;
}
}
{ # Main action - process each filename read in.
filename = $0;
do_one();
}
pages=man section=6 verbose= curdir=/usr/local/share/man/man6
awk: line 74: syntax error at or near ||
awk: line 75: extra ')'
awk: line 78: syntax error at or near else
awk: line 81: syntax error at or near }
awk: line 151: syntax error at or near }
+ cd ..
+ [ -d man7 ]
+ cd man7
+ section=7
+ curdir=/usr/local/share/man/man7
+ export section verbose curdir
+ find /usr/local/share/man/man7/. -name * -type f -size +0 -ctime 0 -print
+ /bin/awk
function readline() {
if (use_zcat || use_bzcat) {
result = (pipe_cmd | getline);
if (result < 0) {
print "Pipe error: " pipe_cmd " " ERRNO > "/dev/stderr";
}
} else {
result = (getline < filename);
if (result < 0) {
print "Read file error: " filename " " ERRNO > "/dev/stderr";
}
}
return result;
}
function closeline() {
if (use_zcat || use_bzcat) {
return close(pipe_cmd);
} else {
return close(filename);
}
}
function do_one() {
insh = 0; thisjoin = 1; done = 0;
entire_line = "";
if (verbose) {
print "adding " filename > "/dev/stderr"
}
use_zcat = match(filename,"\\.Z$") ||
match(filename,"\\.z$") || match(filename,"\\.gz$");
if (!use_zcat)
use_bzcat = match(filename,"\\.bz2");
if (use_zcat || use_bzcat) {
filename_no_gz = substr(filename, 0, RSTART - 1);
} else {
filename_no_gz = filename;
}
match(filename_no_gz, "/[^/]+$");
progname = substr(filename, RSTART + 1, RLENGTH - 1);
if (match(progname, "\\." section "[A-Za-z]+")) {
actual_section = substr(progname, RSTART + 1, RLENGTH - 1);
} else {
actual_section = section;
}
sub(/\..*/, "", progname);
if (use_zcat || use_bzcat) {
if (use_zcat) {
pipe_cmd = "zcat \"" filename "\"";
} else {
pipe_cmd = "bzcat \"" filename "\"";
}
# try to avoid suspicious stuff
if (filename ~ /[;&|`$(]/) {
print "ignored strange file name " filename " in " curdir > "/dev/stderr";
return;
}
}
while (!done && readline() > 0) {
gsub(/.\b/, "");
if (($1 ~ /^\.[Ss][Hh]/ &&
($2 ~ /[Nn][Aa][Mm][Ee]/ ||
$2 ~ /^JMÉNO/ || $2 ~ /^NAVN/ || $2 ~ /^NUME/ ||
$2 ~ /^BEZEICHNUNG/ || $2 ~ /^NOMBRE/ ||
$2 ~ /^NIMI/ || $2 ~ /^NOM/ || $2 ~ /^IME/ ||
$2 ~ /^N[ÉE]V/ || $2 ~ /^NAMA/ || $2 ~ /^̾Á°/ ||
$2 ~ /^̾¾Î/ || $2 ~ /^À̸§/ || $2 ~ /^NAZWA/ ||
$2 ~ /^îáú÷áîéå/ || $2 ~ /^Ãû³Æ/ || $2 ~ /^¦WºÙ/ ||
$2 ~ /^NOME/ || $2 ~ /^NAAM/) || $2 ~ /^ÈÌÅ/)) ||
(pages == "cat" && $1 ~ /^NAME/)) {
if (!insh) {
insh = 1;
} else {
done = 1;
}
} else if (insh) {
if ($1 ~ /^\.[Ss][HhYS]/ ||
(pages == "cat" &&
($1 ~ /^S[yYeE]/ || $1 ~ /^DESCRIPTION/ ||
$1 ~ /^COMMAND/ || $1 ~ /^OVERVIEW/ ||
$1 ~ /^STRUCTURES/ || $1 ~ /^INTRODUCTION/ ||
$0 ~ /^[^ ]/))) {
# end insh for Synopsis, Syntax, but also for
# DESCRIPTION (e.g., XFree86.1x),
# COMMAND (e.g., xspread.1)
# OVERVIEW (e.g., TclCommandWriting.3)
# STRUCTURES (e.g., XEvent.3x)
# INTRODUCTION (e.g., TclX.n)
# and anything at all that begins in Column 1, so
# is probably a section header.
done = 1;
} else {
if ($0 ~ progname"-") { # Fix old cat pages
sub(progname"-", progname" - ");
}
if ($0 ~ /[^ \\]-$/) {
sub(/-$/, ""); # Handle Hyphenations
nextjoin = 1;
} else if ($0 ~ /\\c$/) {
sub(/\\c$/, ""); # Handle Continuations
nextjoin = 1;
} else
nextjoin = 0;
sub(/^.[IB] /, ""); # Kill bold and italics
sub(/^.BI /, ""); #
sub(/^.SM /, ""); # Kill small
sub(/^.Nm /, ""); # Kill bold
sub(/^.Tn /, ""); # Kill normal
sub(/^.Li /, ""); # Kill .Li
sub(/^.Dq /, ""); # Kill .Dq
sub(/^.Nd */, "- "); # Convert .Nd to dash
sub(/\\\".*/, ""); # Trim pending comments
sub(/ *$/, ""); # Trim pending spaces
sub(/^\.$/, ""); # Kill blank comments
sub(/^'.*/, ""); # Kill comment/troff lines
sub(/^.in .*/, ""); # Kill various macros
sub(/^.ti .*/, "");
sub(/^.ta .*/, "");
sub(/^.Vb .*/, "");
sub(/^.[PLTH]P$/, ""); # .PP/.LP/.TP/.HP
sub(/^.Pp$/, "");
sub(/^.[iI]X .*$/, "");
sub(/^.nolinks$/, "");
sub(/^.B$/, "");
sub(/^.nf$/, "");
if (($1 ~ /^\.../ || $1 == "") &&
(entire_line ~ / - / || entire_line ~ / \\- /)) {
# Assume that this ends the description of one line
# Sometimes there are several descriptions in one page,
# as in outb(2).
handle_entire_line();
entire_line = "";
thisjoin = 1;
} else {
if (thisjoin) {
entire_line = entire_line $0;
} else {
entire_line = entire_line " " $0;
}
thisjoin = nextjoin;
}
}
}
}
handle_entire_line();
closeline();
}
function handle_entire_line() {
x = entire_line; # Keep it short
gsub(/\015/, "", x); # Kill DOS remains
gsub(/ /, " ", x); # Translate tabs to spaces
gsub(/ +/, " ", x); # Collapse spaces
gsub(/ *, */, ", ", x); # Fix comma spacings
sub(/^ /, "", x); # Kill initial spaces
sub(/ $/, "", x); # Kill trailing spaces
sub(/__+/, "_", x); # Collapse underscores
gsub(/\\f\(../, "", x); # Kill font changes
gsub(/\\f[PRIB0123]/, "", x); # Kill font changes
gsub(/\\s[-+0-9]*/, "", x); # Kill size changes
gsub(/\\&/, "", x); # Kill \&
gsub(/\\\|/, "", x); # Kill \|
gsub(/\\\((ru|ul)/, "_", x); # Translate
gsub(/\\\((mi|hy|em)/, "-", x); # Translate
gsub(/\\\*\(../, "", x); # Kill troff strings
gsub(/\\/, "", x); # Kill all backslashes
gsub(/"/, "", x); # Kill quotes (from .Nd "foo bar")
sub(/<h1 align=center>/, "", x);# Yuk! HTML cruft
gsub(/\000.*/, "X", x); # Binary cruft in LAPACK pages
gsub(/ +/, " ", x); # Collapse spaces (again)
sub(/^ /, "", x); # Kill initial spaces (again)
sub(/ $/, "", x); # Kill trailing spaces (again)
sub(/\.$/, "", x); # Kill trailing period
if (!match(x, / - /))
return;
after_dash = substr(x, RSTART);
head = substr(x, 1, RSTART-1) ", ";
while (match(head, /, /)) {
prog = substr(head, 1, RSTART-1);
head = substr(head, RSTART+2);
if (prog != progname)
prog = prog " [" progname "]";
printf "%-*s (%s) %s\n", 20, prog, actual_section, after_dash;
}
}
{ # Main action - process each filename read in.
filename = $0;
do_one();
}
pages=man section=7 verbose= curdir=/usr/local/share/man/man7
awk: line 74: syntax error at or near ||
awk: line 75: extra ')'
awk: line 78: syntax error at or near else
awk: line 81: syntax error at or near }
awk: line 151: syntax error at or near }
+ cd ..
+ [ -d man8 ]
+ cd man8
+ section=8
+ curdir=/usr/local/share/man/man8
+ export section verbose curdir
+ find /usr/local/share/man/man8/. -name * -type f -size +0 -ctime 0 -print
+ /bin/awk
function readline() {
if (use_zcat || use_bzcat) {
result = (pipe_cmd | getline);
if (result < 0) {
print "Pipe error: " pipe_cmd " " ERRNO > "/dev/stderr";
}
} else {
result = (getline < filename);
if (result < 0) {
print "Read file error: " filename " " ERRNO > "/dev/stderr";
}
}
return result;
}
function closeline() {
if (use_zcat || use_bzcat) {
return close(pipe_cmd);
} else {
return close(filename);
}
}
function do_one() {
insh = 0; thisjoin = 1; done = 0;
entire_line = "";
if (verbose) {
print "adding " filename > "/dev/stderr"
}
use_zcat = match(filename,"\\.Z$") ||
match(filename,"\\.z$") || match(filename,"\\.gz$");
if (!use_zcat)
use_bzcat = match(filename,"\\.bz2");
if (use_zcat || use_bzcat) {
filename_no_gz = substr(filename, 0, RSTART - 1);
} else {
filename_no_gz = filename;
}
match(filename_no_gz, "/[^/]+$");
progname = substr(filename, RSTART + 1, RLENGTH - 1);
if (match(progname, "\\." section "[A-Za-z]+")) {
actual_section = substr(progname, RSTART + 1, RLENGTH - 1);
} else {
actual_section = section;
}
sub(/\..*/, "", progname);
if (use_zcat || use_bzcat) {
if (use_zcat) {
pipe_cmd = "zcat \"" filename "\"";
} else {
pipe_cmd = "bzcat \"" filename "\"";
}
# try to avoid suspicious stuff
if (filename ~ /[;&|`$(]/) {
print "ignored strange file name " filename " in " curdir > "/dev/stderr";
return;
}
}
while (!done && readline() > 0) {
gsub(/.\b/, "");
if (($1 ~ /^\.[Ss][Hh]/ &&
($2 ~ /[Nn][Aa][Mm][Ee]/ ||
$2 ~ /^JMÉNO/ || $2 ~ /^NAVN/ || $2 ~ /^NUME/ ||
$2 ~ /^BEZEICHNUNG/ || $2 ~ /^NOMBRE/ ||
$2 ~ /^NIMI/ || $2 ~ /^NOM/ || $2 ~ /^IME/ ||
$2 ~ /^N[ÉE]V/ || $2 ~ /^NAMA/ || $2 ~ /^̾Á°/ ||
$2 ~ /^̾¾Î/ || $2 ~ /^À̸§/ || $2 ~ /^NAZWA/ ||
$2 ~ /^îáú÷áîéå/ || $2 ~ /^Ãû³Æ/ || $2 ~ /^¦WºÙ/ ||
$2 ~ /^NOME/ || $2 ~ /^NAAM/) || $2 ~ /^ÈÌÅ/)) ||
(pages == "cat" && $1 ~ /^NAME/)) {
if (!insh) {
insh = 1;
} else {
done = 1;
}
} else if (insh) {
if ($1 ~ /^\.[Ss][HhYS]/ ||
(pages == "cat" &&
($1 ~ /^S[yYeE]/ || $1 ~ /^DESCRIPTION/ ||
$1 ~ /^COMMAND/ || $1 ~ /^OVERVIEW/ ||
$1 ~ /^STRUCTURES/ || $1 ~ /^INTRODUCTION/ ||
$0 ~ /^[^ ]/))) {
# end insh for Synopsis, Syntax, but also for
# DESCRIPTION (e.g., XFree86.1x),
# COMMAND (e.g., xspread.1)
# OVERVIEW (e.g., TclCommandWriting.3)
# STRUCTURES (e.g., XEvent.3x)
# INTRODUCTION (e.g., TclX.n)
# and anything at all that begins in Column 1, so
# is probably a section header.
done = 1;
} else {
if ($0 ~ progname"-") { # Fix old cat pages
sub(progname"-", progname" - ");
}
if ($0 ~ /[^ \\]-$/) {
sub(/-$/, ""); # Handle Hyphenations
nextjoin = 1;
} else if ($0 ~ /\\c$/) {
sub(/\\c$/, ""); # Handle Continuations
nextjoin = 1;
} else
nextjoin = 0;
sub(/^.[IB] /, ""); # Kill bold and italics
sub(/^.BI /, ""); #
sub(/^.SM /, ""); # Kill small
sub(/^.Nm /, ""); # Kill bold
sub(/^.Tn /, ""); # Kill normal
sub(/^.Li /, ""); # Kill .Li
sub(/^.Dq /, ""); # Kill .Dq
sub(/^.Nd */, "- "); # Convert .Nd to dash
sub(/\\\".*/, ""); # Trim pending comments
sub(/ *$/, ""); # Trim pending spaces
sub(/^\.$/, ""); # Kill blank comments
sub(/^'.*/, ""); # Kill comment/troff lines
sub(/^.in .*/, ""); # Kill various macros
sub(/^.ti .*/, "");
sub(/^.ta .*/, "");
sub(/^.Vb .*/, "");
sub(/^.[PLTH]P$/, ""); # .PP/.LP/.TP/.HP
sub(/^.Pp$/, "");
sub(/^.[iI]X .*$/, "");
sub(/^.nolinks$/, "");
sub(/^.B$/, "");
sub(/^.nf$/, "");
if (($1 ~ /^\.../ || $1 == "") &&
(entire_line ~ / - / || entire_line ~ / \\- /)) {
# Assume that this ends the description of one line
# Sometimes there are several descriptions in one page,
# as in outb(2).
handle_entire_line();
entire_line = "";
thisjoin = 1;
} else {
if (thisjoin) {
entire_line = entire_line $0;
} else {
entire_line = entire_line " " $0;
}
thisjoin = nextjoin;
}
}
}
}
handle_entire_line();
closeline();
}
function handle_entire_line() {
x = entire_line; # Keep it short
gsub(/\015/, "", x); # Kill DOS remains
gsub(/ /, " ", x); # Translate tabs to spaces
gsub(/ +/, " ", x); # Collapse spaces
gsub(/ *, */, ", ", x); # Fix comma spacings
sub(/^ /, "", x); # Kill initial spaces
sub(/ $/, "", x); # Kill trailing spaces
sub(/__+/, "_", x); # Collapse underscores
gsub(/\\f\(../, "", x); # Kill font changes
gsub(/\\f[PRIB0123]/, "", x); # Kill font changes
gsub(/\\s[-+0-9]*/, "", x); # Kill size changes
gsub(/\\&/, "", x); # Kill \&
gsub(/\\\|/, "", x); # Kill \|
gsub(/\\\((ru|ul)/, "_", x); # Translate
gsub(/\\\((mi|hy|em)/, "-", x); # Translate
gsub(/\\\*\(../, "", x); # Kill troff strings
gsub(/\\/, "", x); # Kill all backslashes
gsub(/"/, "", x); # Kill quotes (from .Nd "foo bar")
sub(/<h1 align=center>/, "", x);# Yuk! HTML cruft
gsub(/\000.*/, "X", x); # Binary cruft in LAPACK pages
gsub(/ +/, " ", x); # Collapse spaces (again)
sub(/^ /, "", x); # Kill initial spaces (again)
sub(/ $/, "", x); # Kill trailing spaces (again)
sub(/\.$/, "", x); # Kill trailing period
if (!match(x, / - /))
return;
after_dash = substr(x, RSTART);
head = substr(x, 1, RSTART-1) ", ";
while (match(head, /, /)) {
prog = substr(head, 1, RSTART-1);
head = substr(head, RSTART+2);
if (prog != progname)
prog = prog " [" progname "]";
printf "%-*s (%s) %s\n", 20, prog, actual_section, after_dash;
}
}
{ # Main action - process each filename read in.
filename = $0;
do_one();
}
pages=man section=8 verbose= curdir=/usr/local/share/man/man8
awk: line 74: syntax error at or near ||
awk: line 75: extra ')'
awk: line 78: syntax error at or near else
awk: line 81: syntax error at or near }
awk: line 151: syntax error at or near }
+ cd ..
+ [ -d man9 ]
+ [ -d mann ]
+ [ -d manl ]
+ cd /tmp
+ mandir1=/usr/local/share/man
+ [ x != x ]
+ [ -s /usr/local/share/man/whatis ]
+ tr -s \n
+ < /var/tmp/tmpwhatisrhNeCA/w
+ sort -u
+ > /usr/local/share/man/whatis
+ chmod 644 /usr/local/share/man/whatis
+ rm /var/tmp/tmpwhatisrhNeCA/w
+ [ x != x ]
+ [ -s /usr/local/man/whatis -a man = man -a x1 = x ]
+ pwd
+ here=/tmp
+ cd /usr/local/man
+ > /var/tmp/tmpwhatisrhNeCA/w
+ [ -d man1 ]
+ cd man1
+ section=1
+ curdir=/usr/local/man/man1
+ export section verbose curdir
+ find /usr/local/man/man1/. -name * -type f -size +0 -ctime 0 -print
+ /bin/awk
function readline() {
if (use_zcat || use_bzcat) {
result = (pipe_cmd | getline);
if (result < 0) {
print "Pipe error: " pipe_cmd " " ERRNO > "/dev/stderr";
}
} else {
result = (getline < filename);
if (result < 0) {
print "Read file error: " filename " " ERRNO > "/dev/stderr";
}
}
return result;
}
function closeline() {
if (use_zcat || use_bzcat) {
return close(pipe_cmd);
} else {
return close(filename);
}
}
function do_one() {
insh = 0; thisjoin = 1; done = 0;
entire_line = "";
if (verbose) {
print "adding " filename > "/dev/stderr"
}
use_zcat = match(filename,"\\.Z$") ||
match(filename,"\\.z$") || match(filename,"\\.gz$");
if (!use_zcat)
use_bzcat = match(filename,"\\.bz2");
if (use_zcat || use_bzcat) {
filename_no_gz = substr(filename, 0, RSTART - 1);
} else {
filename_no_gz = filename;
}
match(filename_no_gz, "/[^/]+$");
progname = substr(filename, RSTART + 1, RLENGTH - 1);
if (match(progname, "\\." section "[A-Za-z]+")) {
actual_section = substr(progname, RSTART + 1, RLENGTH - 1);
} else {
actual_section = section;
}
sub(/\..*/, "", progname);
if (use_zcat || use_bzcat) {
if (use_zcat) {
pipe_cmd = "zcat \"" filename "\"";
} else {
pipe_cmd = "bzcat \"" filename "\"";
}
# try to avoid suspicious stuff
if (filename ~ /[;&|`$(]/) {
print "ignored strange file name " filename " in " curdir > "/dev/stderr";
return;
}
}
while (!done && readline() > 0) {
gsub(/.\b/, "");
if (($1 ~ /^\.[Ss][Hh]/ &&
($2 ~ /[Nn][Aa][Mm][Ee]/ ||
$2 ~ /^JMÉNO/ || $2 ~ /^NAVN/ || $2 ~ /^NUME/ ||
$2 ~ /^BEZEICHNUNG/ || $2 ~ /^NOMBRE/ ||
$2 ~ /^NIMI/ || $2 ~ /^NOM/ || $2 ~ /^IME/ ||
$2 ~ /^N[ÉE]V/ || $2 ~ /^NAMA/ || $2 ~ /^̾Á°/ ||
$2 ~ /^̾¾Î/ || $2 ~ /^À̸§/ || $2 ~ /^NAZWA/ ||
$2 ~ /^îáú÷áîéå/ || $2 ~ /^Ãû³Æ/ || $2 ~ /^¦WºÙ/ ||
$2 ~ /^NOME/ || $2 ~ /^NAAM/) || $2 ~ /^ÈÌÅ/)) ||
(pages == "cat" && $1 ~ /^NAME/)) {
if (!insh) {
insh = 1;
} else {
done = 1;
}
} else if (insh) {
if ($1 ~ /^\.[Ss][HhYS]/ ||
(pages == "cat" &&
($1 ~ /^S[yYeE]/ || $1 ~ /^DESCRIPTION/ ||
$1 ~ /^COMMAND/ || $1 ~ /^OVERVIEW/ ||
$1 ~ /^STRUCTURES/ || $1 ~ /^INTRODUCTION/ ||
$0 ~ /^[^ ]/))) {
# end insh for Synopsis, Syntax, but also for
# DESCRIPTION (e.g., XFree86.1x),
# COMMAND (e.g., xspread.1)
# OVERVIEW (e.g., TclCommandWriting.3)
# STRUCTURES (e.g., XEvent.3x)
# INTRODUCTION (e.g., TclX.n)
# and anything at all that begins in Column 1, so
# is probably a section header.
done = 1;
} else {
if ($0 ~ progname"-") { # Fix old cat pages
sub(progname"-", progname" - ");
}
if ($0 ~ /[^ \\]-$/) {
sub(/-$/, ""); # Handle Hyphenations
nextjoin = 1;
} else if ($0 ~ /\\c$/) {
sub(/\\c$/, ""); # Handle Continuations
nextjoin = 1;
} else
nextjoin = 0;
sub(/^.[IB] /, ""); # Kill bold and italics
sub(/^.BI /, ""); #
sub(/^.SM /, ""); # Kill small
sub(/^.Nm /, ""); # Kill bold
sub(/^.Tn /, ""); # Kill normal
sub(/^.Li /, ""); # Kill .Li
sub(/^.Dq /, ""); # Kill .Dq
sub(/^.Nd */, "- "); # Convert .Nd to dash
sub(/\\\".*/, ""); # Trim pending comments
sub(/ *$/, ""); # Trim pending spaces
sub(/^\.$/, ""); # Kill blank comments
sub(/^'.*/, ""); # Kill comment/troff lines
sub(/^.in .*/, ""); # Kill various macros
sub(/^.ti .*/, "");
sub(/^.ta .*/, "");
sub(/^.Vb .*/, "");
sub(/^.[PLTH]P$/, ""); # .PP/.LP/.TP/.HP
sub(/^.Pp$/, "");
sub(/^.[iI]X .*$/, "");
sub(/^.nolinks$/, "");
sub(/^.B$/, "");
sub(/^.nf$/, "");
if (($1 ~ /^\.../ || $1 == "") &&
(entire_line ~ / - / || entire_line ~ / \\- /)) {
# Assume that this ends the description of one line
# Sometimes there are several descriptions in one page,
# as in outb(2).
handle_entire_line();
entire_line = "";
thisjoin = 1;
} else {
if (thisjoin) {
entire_line = entire_line $0;
} else {
entire_line = entire_line " " $0;
}
thisjoin = nextjoin;
}
}
}
}
handle_entire_line();
closeline();
}
function handle_entire_line() {
x = entire_line; # Keep it short
gsub(/\015/, "", x); # Kill DOS remains
gsub(/ /, " ", x); # Translate tabs to spaces
gsub(/ +/, " ", x); # Collapse spaces
gsub(/ *, */, ", ", x); # Fix comma spacings
sub(/^ /, "", x); # Kill initial spaces
sub(/ $/, "", x); # Kill trailing spaces
sub(/__+/, "_", x); # Collapse underscores
gsub(/\\f\(../, "", x); # Kill font changes
gsub(/\\f[PRIB0123]/, "", x); # Kill font changes
gsub(/\\s[-+0-9]*/, "", x); # Kill size changes
gsub(/\\&/, "", x); # Kill \&
gsub(/\\\|/, "", x); # Kill \|
gsub(/\\\((ru|ul)/, "_", x); # Translate
gsub(/\\\((mi|hy|em)/, "-", x); # Translate
gsub(/\\\*\(../, "", x); # Kill troff strings
gsub(/\\/, "", x); # Kill all backslashes
gsub(/"/, "", x); # Kill quotes (from .Nd "foo bar")
sub(/<h1 align=center>/, "", x);# Yuk! HTML cruft
gsub(/\000.*/, "X", x); # Binary cruft in LAPACK pages
gsub(/ +/, " ", x); # Collapse spaces (again)
sub(/^ /, "", x); # Kill initial spaces (again)
sub(/ $/, "", x); # Kill trailing spaces (again)
sub(/\.$/, "", x); # Kill trailing period
if (!match(x, / - /))
return;
after_dash = substr(x, RSTART);
head = substr(x, 1, RSTART-1) ", ";
while (match(head, /, /)) {
prog = substr(head, 1, RSTART-1);
head = substr(head, RSTART+2);
if (prog != progname)
prog = prog " [" progname "]";
printf "%-*s (%s) %s\n", 20, prog, actual_section, after_dash;
}
}
{ # Main action - process each filename read in.
filename = $0;
do_one();
}
pages=man section=1 verbose= curdir=/usr/local/man/man1
awk: line 74: syntax error at or near ||
awk: line 75: extra ')'
awk: line 78: syntax error at or near else
awk: line 81: syntax error at or near }
awk: line 151: syntax error at or near }
+ cd ..
+ [ -d man2 ]
+ cd man2
+ section=2
+ curdir=/usr/local/man/man2
+ export section verbose curdir
+ find /usr/local/man/man2/. -name * -type f -size +0 -ctime 0 -print
+ /bin/awk
function readline() {
if (use_zcat || use_bzcat) {
result = (pipe_cmd | getline);
if (result < 0) {
print "Pipe error: " pipe_cmd " " ERRNO > "/dev/stderr";
}
} else {
result = (getline < filename);
if (result < 0) {
print "Read file error: " filename " " ERRNO > "/dev/stderr";
}
}
return result;
}
function closeline() {
if (use_zcat || use_bzcat) {
return close(pipe_cmd);
} else {
return close(filename);
}
}
function do_one() {
insh = 0; thisjoin = 1; done = 0;
entire_line = "";
if (verbose) {
print "adding " filename > "/dev/stderr"
}
use_zcat = match(filename,"\\.Z$") ||
match(filename,"\\.z$") || match(filename,"\\.gz$");
if (!use_zcat)
use_bzcat = match(filename,"\\.bz2");
if (use_zcat || use_bzcat) {
filename_no_gz = substr(filename, 0, RSTART - 1);
} else {
filename_no_gz = filename;
}
match(filename_no_gz, "/[^/]+$");
progname = substr(filename, RSTART + 1, RLENGTH - 1);
if (match(progname, "\\." section "[A-Za-z]+")) {
actual_section = substr(progname, RSTART + 1, RLENGTH - 1);
} else {
actual_section = section;
}
sub(/\..*/, "", progname);
if (use_zcat || use_bzcat) {
if (use_zcat) {
pipe_cmd = "zcat \"" filename "\"";
} else {
pipe_cmd = "bzcat \"" filename "\"";
}
# try to avoid suspicious stuff
if (filename ~ /[;&|`$(]/) {
print "ignored strange file name " filename " in " curdir > "/dev/stderr";
return;
}
}
while (!done && readline() > 0) {
gsub(/.\b/, "");
if (($1 ~ /^\.[Ss][Hh]/ &&
($2 ~ /[Nn][Aa][Mm][Ee]/ ||
$2 ~ /^JMÉNO/ || $2 ~ /^NAVN/ || $2 ~ /^NUME/ ||
$2 ~ /^BEZEICHNUNG/ || $2 ~ /^NOMBRE/ ||
$2 ~ /^NIMI/ || $2 ~ /^NOM/ || $2 ~ /^IME/ ||
$2 ~ /^N[ÉE]V/ || $2 ~ /^NAMA/ || $2 ~ /^̾Á°/ ||
$2 ~ /^̾¾Î/ || $2 ~ /^À̸§/ || $2 ~ /^NAZWA/ ||
$2 ~ /^îáú÷áîéå/ || $2 ~ /^Ãû³Æ/ || $2 ~ /^¦WºÙ/ ||
$2 ~ /^NOME/ || $2 ~ /^NAAM/) || $2 ~ /^ÈÌÅ/)) ||
(pages == "cat" && $1 ~ /^NAME/)) {
if (!insh) {
insh = 1;
} else {
done = 1;
}
} else if (insh) {
if ($1 ~ /^\.[Ss][HhYS]/ ||
(pages == "cat" &&
($1 ~ /^S[yYeE]/ || $1 ~ /^DESCRIPTION/ ||
$1 ~ /^COMMAND/ || $1 ~ /^OVERVIEW/ ||
$1 ~ /^STRUCTURES/ || $1 ~ /^INTRODUCTION/ ||
$0 ~ /^[^ ]/))) {
# end insh for Synopsis, Syntax, but also for
# DESCRIPTION (e.g., XFree86.1x),
# COMMAND (e.g., xspread.1)
# OVERVIEW (e.g., TclCommandWriting.3)
# STRUCTURES (e.g., XEvent.3x)
# INTRODUCTION (e.g., TclX.n)
# and anything at all that begins in Column 1, so
# is probably a section header.
done = 1;
} else {
if ($0 ~ progname"-") { # Fix old cat pages
sub(progname"-", progname" - ");
}
if ($0 ~ /[^ \\]-$/) {
sub(/-$/, ""); # Handle Hyphenations
nextjoin = 1;
} else if ($0 ~ /\\c$/) {
sub(/\\c$/, ""); # Handle Continuations
nextjoin = 1;
} else
nextjoin = 0;
sub(/^.[IB] /, ""); # Kill bold and italics
sub(/^.BI /, ""); #
sub(/^.SM /, ""); # Kill small
sub(/^.Nm /, ""); # Kill bold
sub(/^.Tn /, ""); # Kill normal
sub(/^.Li /, ""); # Kill .Li
sub(/^.Dq /, ""); # Kill .Dq
sub(/^.Nd */, "- "); # Convert .Nd to dash
sub(/\\\".*/, ""); # Trim pending comments
sub(/ *$/, ""); # Trim pending spaces
sub(/^\.$/, ""); # Kill blank comments
sub(/^'.*/, ""); # Kill comment/troff lines
sub(/^.in .*/, ""); # Kill various macros
sub(/^.ti .*/, "");
sub(/^.ta .*/, "");
sub(/^.Vb .*/, "");
sub(/^.[PLTH]P$/, ""); # .PP/.LP/.TP/.HP
sub(/^.Pp$/, "");
sub(/^.[iI]X .*$/, "");
sub(/^.nolinks$/, "");
sub(/^.B$/, "");
sub(/^.nf$/, "");
if (($1 ~ /^\.../ || $1 == "") &&
(entire_line ~ / - / || entire_line ~ / \\- /)) {
# Assume that this ends the description of one line
# Sometimes there are several descriptions in one page,
# as in outb(2).
handle_entire_line();
entire_line = "";
thisjoin = 1;
} else {
if (thisjoin) {
entire_line = entire_line $0;
} else {
entire_line = entire_line " " $0;
}
thisjoin = nextjoin;
}
}
}
}
handle_entire_line();
closeline();
}
function handle_entire_line() {
x = entire_line; # Keep it short
gsub(/\015/, "", x); # Kill DOS remains
gsub(/ /, " ", x); # Translate tabs to spaces
gsub(/ +/, " ", x); # Collapse spaces
gsub(/ *, */, ", ", x); # Fix comma spacings
sub(/^ /, "", x); # Kill initial spaces
sub(/ $/, "", x); # Kill trailing spaces
sub(/__+/, "_", x); # Collapse underscores
gsub(/\\f\(../, "", x); # Kill font changes
gsub(/\\f[PRIB0123]/, "", x); # Kill font changes
gsub(/\\s[-+0-9]*/, "", x); # Kill size changes
gsub(/\\&/, "", x); # Kill \&
gsub(/\\\|/, "", x); # Kill \|
gsub(/\\\((ru|ul)/, "_", x); # Translate
gsub(/\\\((mi|hy|em)/, "-", x); # Translate
gsub(/\\\*\(../, "", x); # Kill troff strings
gsub(/\\/, "", x); # Kill all backslashes
gsub(/"/, "", x); # Kill quotes (from .Nd "foo bar")
sub(/<h1 align=center>/, "", x);# Yuk! HTML cruft
gsub(/\000.*/, "X", x); # Binary cruft in LAPACK pages
gsub(/ +/, " ", x); # Collapse spaces (again)
sub(/^ /, "", x); # Kill initial spaces (again)
sub(/ $/, "", x); # Kill trailing spaces (again)
sub(/\.$/, "", x); # Kill trailing period
if (!match(x, / - /))
return;
after_dash = substr(x, RSTART);
head = substr(x, 1, RSTART-1) ", ";
while (match(head, /, /)) {
prog = substr(head, 1, RSTART-1);
head = substr(head, RSTART+2);
if (prog != progname)
prog = prog " [" progname "]";
printf "%-*s (%s) %s\n", 20, prog, actual_section, after_dash;
}
}
{ # Main action - process each filename read in.
filename = $0;
do_one();
}
pages=man section=2 verbose= curdir=/usr/local/man/man2
awk: line 74: syntax error at or near ||
awk: line 75: extra ')'
awk: line 78: syntax error at or near else
awk: line 81: syntax error at or near }
awk: line 151: syntax error at or near }
+ cd ..
+ [ -d man3 ]
+ cd man3
+ section=3
+ curdir=/usr/local/man/man3
+ export section verbose curdir
+ find /usr/local/man/man3/. -name * -type f -size +0 -ctime 0 -print
+ /bin/awk
function readline() {
if (use_zcat || use_bzcat) {
result = (pipe_cmd | getline);
if (result < 0) {
print "Pipe error: " pipe_cmd " " ERRNO > "/dev/stderr";
}
} else {
result = (getline < filename);
if (result < 0) {
print "Read file error: " filename " " ERRNO > "/dev/stderr";
}
}
return result;
}
function closeline() {
if (use_zcat || use_bzcat) {
return close(pipe_cmd);
} else {
return close(filename);
}
}
function do_one() {
insh = 0; thisjoin = 1; done = 0;
entire_line = "";
if (verbose) {
print "adding " filename > "/dev/stderr"
}
use_zcat = match(filename,"\\.Z$") ||
match(filename,"\\.z$") || match(filename,"\\.gz$");
if (!use_zcat)
use_bzcat = match(filename,"\\.bz2");
if (use_zcat || use_bzcat) {
filename_no_gz = substr(filename, 0, RSTART - 1);
} else {
filename_no_gz = filename;
}
match(filename_no_gz, "/[^/]+$");
progname = substr(filename, RSTART + 1, RLENGTH - 1);
if (match(progname, "\\." section "[A-Za-z]+")) {
actual_section = substr(progname, RSTART + 1, RLENGTH - 1);
} else {
actual_section = section;
}
sub(/\..*/, "", progname);
if (use_zcat || use_bzcat) {
if (use_zcat) {
pipe_cmd = "zcat \"" filename "\"";
} else {
pipe_cmd = "bzcat \"" filename "\"";
}
# try to avoid suspicious stuff
if (filename ~ /[;&|`$(]/) {
print "ignored strange file name " filename " in " curdir > "/dev/stderr";
return;
}
}
while (!done && readline() > 0) {
gsub(/.\b/, "");
if (($1 ~ /^\.[Ss][Hh]/ &&
($2 ~ /[Nn][Aa][Mm][Ee]/ ||
$2 ~ /^JMÉNO/ || $2 ~ /^NAVN/ || $2 ~ /^NUME/ ||
$2 ~ /^BEZEICHNUNG/ || $2 ~ /^NOMBRE/ ||
$2 ~ /^NIMI/ || $2 ~ /^NOM/ || $2 ~ /^IME/ ||
$2 ~ /^N[ÉE]V/ || $2 ~ /^NAMA/ || $2 ~ /^̾Á°/ ||
$2 ~ /^̾¾Î/ || $2 ~ /^À̸§/ || $2 ~ /^NAZWA/ ||
$2 ~ /^îáú÷áîéå/ || $2 ~ /^Ãû³Æ/ || $2 ~ /^¦WºÙ/ ||
$2 ~ /^NOME/ || $2 ~ /^NAAM/) || $2 ~ /^ÈÌÅ/)) ||
(pages == "cat" && $1 ~ /^NAME/)) {
if (!insh) {
insh = 1;
} else {
done = 1;
}
} else if (insh) {
if ($1 ~ /^\.[Ss][HhYS]/ ||
(pages == "cat" &&
($1 ~ /^S[yYeE]/ || $1 ~ /^DESCRIPTION/ ||
$1 ~ /^COMMAND/ || $1 ~ /^OVERVIEW/ ||
$1 ~ /^STRUCTURES/ || $1 ~ /^INTRODUCTION/ ||
$0 ~ /^[^ ]/))) {
# end insh for Synopsis, Syntax, but also for
# DESCRIPTION (e.g., XFree86.1x),
# COMMAND (e.g., xspread.1)
# OVERVIEW (e.g., TclCommandWriting.3)
# STRUCTURES (e.g., XEvent.3x)
# INTRODUCTION (e.g., TclX.n)
# and anything at all that begins in Column 1, so
# is probably a section header.
done = 1;
} else {
if ($0 ~ progname"-") { # Fix old cat pages
sub(progname"-", progname" - ");
}
if ($0 ~ /[^ \\]-$/) {
sub(/-$/, ""); # Handle Hyphenations
nextjoin = 1;
} else if ($0 ~ /\\c$/) {
sub(/\\c$/, ""); # Handle Continuations
nextjoin = 1;
} else
nextjoin = 0;
sub(/^.[IB] /, ""); # Kill bold and italics
sub(/^.BI /, ""); #
sub(/^.SM /, ""); # Kill small
sub(/^.Nm /, ""); # Kill bold
sub(/^.Tn /, ""); # Kill normal
sub(/^.Li /, ""); # Kill .Li
sub(/^.Dq /, ""); # Kill .Dq
sub(/^.Nd */, "- "); # Convert .Nd to dash
sub(/\\\".*/, ""); # Trim pending comments
sub(/ *$/, ""); # Trim pending spaces
sub(/^\.$/, ""); # Kill blank comments
sub(/^'.*/, ""); # Kill comment/troff lines
sub(/^.in .*/, ""); # Kill various macros
sub(/^.ti .*/, "");
sub(/^.ta .*/, "");
sub(/^.Vb .*/, "");
sub(/^.[PLTH]P$/, ""); # .PP/.LP/.TP/.HP
sub(/^.Pp$/, "");
sub(/^.[iI]X .*$/, "");
sub(/^.nolinks$/, "");
sub(/^.B$/, "");
sub(/^.nf$/, "");
if (($1 ~ /^\.../ || $1 == "") &&
(entire_line ~ / - / || entire_line ~ / \\- /)) {
# Assume that this ends the description of one line
# Sometimes there are several descriptions in one page,
# as in outb(2).
handle_entire_line();
entire_line = "";
thisjoin = 1;
} else {
if (thisjoin) {
entire_line = entire_line $0;
} else {
entire_line = entire_line " " $0;
}
thisjoin = nextjoin;
}
}
}
}
handle_entire_line();
closeline();
}
function handle_entire_line() {
x = entire_line; # Keep it short
gsub(/\015/, "", x); # Kill DOS remains
gsub(/ /, " ", x); # Translate tabs to spaces
gsub(/ +/, " ", x); # Collapse spaces
gsub(/ *, */, ", ", x); # Fix comma spacings
sub(/^ /, "", x); # Kill initial spaces
sub(/ $/, "", x); # Kill trailing spaces
sub(/__+/, "_", x); # Collapse underscores
gsub(/\\f\(../, "", x); # Kill font changes
gsub(/\\f[PRIB0123]/, "", x); # Kill font changes
gsub(/\\s[-+0-9]*/, "", x); # Kill size changes
gsub(/\\&/, "", x); # Kill \&
gsub(/\\\|/, "", x); # Kill \|
gsub(/\\\((ru|ul)/, "_", x); # Translate
gsub(/\\\((mi|hy|em)/, "-", x); # Translate
gsub(/\\\*\(../, "", x); # Kill troff strings
gsub(/\\/, "", x); # Kill all backslashes
gsub(/"/, "", x); # Kill quotes (from .Nd "foo bar")
sub(/<h1 align=center>/, "", x);# Yuk! HTML cruft
gsub(/\000.*/, "X", x); # Binary cruft in LAPACK pages
gsub(/ +/, " ", x); # Collapse spaces (again)
sub(/^ /, "", x); # Kill initial spaces (again)
sub(/ $/, "", x); # Kill trailing spaces (again)
sub(/\.$/, "", x); # Kill trailing period
if (!match(x, / - /))
return;
after_dash = substr(x, RSTART);
head = substr(x, 1, RSTART-1) ", ";
while (match(head, /, /)) {
prog = substr(head, 1, RSTART-1);
head = substr(head, RSTART+2);
if (prog != progname)
prog = prog " [" progname "]";
printf "%-*s (%s) %s\n", 20, prog, actual_section, after_dash;
}
}
{ # Main action - process each filename read in.
filename = $0;
do_one();
}
pages=man section=3 verbose= curdir=/usr/local/man/man3
awk: line 74: syntax error at or near ||
awk: line 75: extra ')'
awk: line 78: syntax error at or near else
awk: line 81: syntax error at or near }
awk: line 151: syntax error at or near }
+ cd ..
+ [ -d man4 ]
+ cd man4
+ section=4
+ curdir=/usr/local/man/man4
+ export section verbose curdir
+ find /usr/local/man/man4/. -name * -type f -size +0 -ctime 0 -print
+ /bin/awk
function readline() {
if (use_zcat || use_bzcat) {
result = (pipe_cmd | getline);
if (result < 0) {
print "Pipe error: " pipe_cmd " " ERRNO > "/dev/stderr";
}
} else {
result = (getline < filename);
if (result < 0) {
print "Read file error: " filename " " ERRNO > "/dev/stderr";
}
}
return result;
}
function closeline() {
if (use_zcat || use_bzcat) {
return close(pipe_cmd);
} else {
return close(filename);
}
}
function do_one() {
insh = 0; thisjoin = 1; done = 0;
entire_line = "";
if (verbose) {
print "adding " filename > "/dev/stderr"
}
use_zcat = match(filename,"\\.Z$") ||
match(filename,"\\.z$") || match(filename,"\\.gz$");
if (!use_zcat)
use_bzcat = match(filename,"\\.bz2");
if (use_zcat || use_bzcat) {
filename_no_gz = substr(filename, 0, RSTART - 1);
} else {
filename_no_gz = filename;
}
match(filename_no_gz, "/[^/]+$");
progname = substr(filename, RSTART + 1, RLENGTH - 1);
if (match(progname, "\\." section "[A-Za-z]+")) {
actual_section = substr(progname, RSTART + 1, RLENGTH - 1);
} else {
actual_section = section;
}
sub(/\..*/, "", progname);
if (use_zcat || use_bzcat) {
if (use_zcat) {
pipe_cmd = "zcat \"" filename "\"";
} else {
pipe_cmd = "bzcat \"" filename "\"";
}
# try to avoid suspicious stuff
if (filename ~ /[;&|`$(]/) {
print "ignored strange file name " filename " in " curdir > "/dev/stderr";
return;
}
}
while (!done && readline() > 0) {
gsub(/.\b/, "");
if (($1 ~ /^\.[Ss][Hh]/ &&
($2 ~ /[Nn][Aa][Mm][Ee]/ ||
$2 ~ /^JMÉNO/ || $2 ~ /^NAVN/ || $2 ~ /^NUME/ ||
$2 ~ /^BEZEICHNUNG/ || $2 ~ /^NOMBRE/ ||
$2 ~ /^NIMI/ || $2 ~ /^NOM/ || $2 ~ /^IME/ ||
$2 ~ /^N[ÉE]V/ || $2 ~ /^NAMA/ || $2 ~ /^̾Á°/ ||
$2 ~ /^̾¾Î/ || $2 ~ /^À̸§/ || $2 ~ /^NAZWA/ ||
$2 ~ /^îáú÷áîéå/ || $2 ~ /^Ãû³Æ/ || $2 ~ /^¦WºÙ/ ||
$2 ~ /^NOME/ || $2 ~ /^NAAM/) || $2 ~ /^ÈÌÅ/)) ||
(pages == "cat" && $1 ~ /^NAME/)) {
if (!insh) {
insh = 1;
} else {
done = 1;
}
} else if (insh) {
if ($1 ~ /^\.[Ss][HhYS]/ ||
(pages == "cat" &&
($1 ~ /^S[yYeE]/ || $1 ~ /^DESCRIPTION/ ||
$1 ~ /^COMMAND/ || $1 ~ /^OVERVIEW/ ||
$1 ~ /^STRUCTURES/ || $1 ~ /^INTRODUCTION/ ||
$0 ~ /^[^ ]/))) {
# end insh for Synopsis, Syntax, but also for
# DESCRIPTION (e.g., XFree86.1x),
# COMMAND (e.g., xspread.1)
# OVERVIEW (e.g., TclCommandWriting.3)
# STRUCTURES (e.g., XEvent.3x)
# INTRODUCTION (e.g., TclX.n)
# and anything at all that begins in Column 1, so
# is probably a section header.
done = 1;
} else {
if ($0 ~ progname"-") { # Fix old cat pages
sub(progname"-", progname" - ");
}
if ($0 ~ /[^ \\]-$/) {
sub(/-$/, ""); # Handle Hyphenations
nextjoin = 1;
} else if ($0 ~ /\\c$/) {
sub(/\\c$/, ""); # Handle Continuations
nextjoin = 1;
} else
nextjoin = 0;
sub(/^.[IB] /, ""); # Kill bold and italics
sub(/^.BI /, ""); #
sub(/^.SM /, ""); # Kill small
sub(/^.Nm /, ""); # Kill bold
sub(/^.Tn /, ""); # Kill normal
sub(/^.Li /, ""); # Kill .Li
sub(/^.Dq /, ""); # Kill .Dq
sub(/^.Nd */, "- "); # Convert .Nd to dash
sub(/\\\".*/, ""); # Trim pending comments
sub(/ *$/, ""); # Trim pending spaces
sub(/^\.$/, ""); # Kill blank comments
sub(/^'.*/, ""); # Kill comment/troff lines
sub(/^.in .*/, ""); # Kill various macros
sub(/^.ti .*/, "");
sub(/^.ta .*/, "");
sub(/^.Vb .*/, "");
sub(/^.[PLTH]P$/, ""); # .PP/.LP/.TP/.HP
sub(/^.Pp$/, "");
sub(/^.[iI]X .*$/, "");
sub(/^.nolinks$/, "");
sub(/^.B$/, "");
sub(/^.nf$/, "");
if (($1 ~ /^\.../ || $1 == "") &&
(entire_line ~ / - / || entire_line ~ / \\- /)) {
# Assume that this ends the description of one line
# Sometimes there are several descriptions in one page,
# as in outb(2).
handle_entire_line();
entire_line = "";
thisjoin = 1;
} else {
if (thisjoin) {
entire_line = entire_line $0;
} else {
entire_line = entire_line " " $0;
}
thisjoin = nextjoin;
}
}
}
}
handle_entire_line();
closeline();
}
function handle_entire_line() {
x = entire_line; # Keep it short
gsub(/\015/, "", x); # Kill DOS remains
gsub(/ /, " ", x); # Translate tabs to spaces
gsub(/ +/, " ", x); # Collapse spaces
gsub(/ *, */, ", ", x); # Fix comma spacings
sub(/^ /, "", x); # Kill initial spaces
sub(/ $/, "", x); # Kill trailing spaces
sub(/__+/, "_", x); # Collapse underscores
gsub(/\\f\(../, "", x); # Kill font changes
gsub(/\\f[PRIB0123]/, "", x); # Kill font changes
gsub(/\\s[-+0-9]*/, "", x); # Kill size changes
gsub(/\\&/, "", x); # Kill \&
gsub(/\\\|/, "", x); # Kill \|
gsub(/\\\((ru|ul)/, "_", x); # Translate
gsub(/\\\((mi|hy|em)/, "-", x); # Translate
gsub(/\\\*\(../, "", x); # Kill troff strings
gsub(/\\/, "", x); # Kill all backslashes
gsub(/"/, "", x); # Kill quotes (from .Nd "foo bar")
sub(/<h1 align=center>/, "", x);# Yuk! HTML cruft
gsub(/\000.*/, "X", x); # Binary cruft in LAPACK pages
gsub(/ +/, " ", x); # Collapse spaces (again)
sub(/^ /, "", x); # Kill initial spaces (again)
sub(/ $/, "", x); # Kill trailing spaces (again)
sub(/\.$/, "", x); # Kill trailing period
if (!match(x, / - /))
return;
after_dash = substr(x, RSTART);
head = substr(x, 1, RSTART-1) ", ";
while (match(head, /, /)) {
prog = substr(head, 1, RSTART-1);
head = substr(head, RSTART+2);
if (prog != progname)
prog = prog " [" progname "]";
printf "%-*s (%s) %s\n", 20, prog, actual_section, after_dash;
}
}
{ # Main action - process each filename read in.
filename = $0;
do_one();
}
pages=man section=4 verbose= curdir=/usr/local/man/man4
awk: line 74: syntax error at or near ||
awk: line 75: extra ')'
awk: line 78: syntax error at or near else
awk: line 81: syntax error at or near }
awk: line 151: syntax error at or near }
+ cd ..
+ [ -d man5 ]
+ cd man5
+ section=5
+ curdir=/usr/local/man/man5
+ export section verbose curdir
+ /bin/awk
function readline() {
if (use_zcat || use_bzcat) {
result = (pipe_cmd | getline);
if (result < 0) {
print "Pipe error: " pipe_cmd " " ERRNO > "/dev/stderr";
}
} else {
result = (getline < filename);
if (result < 0) {
print "Read file error: " filename " " ERRNO > "/dev/stderr";
}
}
return result;
}
function closeline() {
if (use_zcat || use_bzcat) {
return close(pipe_cmd);
} else {
return close(filename);
}
}
function do_one() {
insh = 0; thisjoin = 1; done = 0;
entire_line = "";
if (verbose) {
print "adding " filename > "/dev/stderr"
}
use_zcat = match(filename,"\\.Z$") ||
match(filename,"\\.z$") || match(filename,"\\.gz$");
if (!use_zcat)
use_bzcat = match(filename,"\\.bz2");
if (use_zcat || use_bzcat) {
filename_no_gz = substr(filename, 0, RSTART - 1);
} else {
filename_no_gz = filename;
}
match(filename_no_gz, "/[^/]+$");
progname = substr(filename, RSTART + 1, RLENGTH - 1);
if (match(progname, "\\." section "[A-Za-z]+")) {
actual_section = substr(progname, RSTART + 1, RLENGTH - 1);
} else {
actual_section = section;
}
sub(/\..*/, "", progname);
if (use_zcat || use_bzcat) {
if (use_zcat) {
pipe_cmd = "zcat \"" filename "\"";
} else {
pipe_cmd = "bzcat \"" filename "\"";
}
# try to avoid suspicious stuff
if (filename ~ /[;&|`$(]/) {
print "ignored strange file name " filename " in " curdir > "/dev/stderr";
return;
}
}
while (!done && readline() > 0) {
gsub(/.\b/, "");
if (($1 ~ /^\.[Ss][Hh]/ &&
($2 ~ /[Nn][Aa][Mm][Ee]/ ||
$2 ~ /^JMÉNO/ || $2 ~ /^NAVN/ || $2 ~ /^NUME/ ||
$2 ~ /^BEZEICHNUNG/ || $2 ~ /^NOMBRE/ ||
$2 ~ /^NIMI/ || $2 ~ /^NOM/ || $2 ~ /^IME/ ||
$2 ~ /^N[ÉE]V/ || $2 ~ /^NAMA/ || $2 ~ /^̾Á°/ ||
$2 ~ /^̾¾Î/ || $2 ~ /^À̸§/ || $2 ~ /^NAZWA/ ||
$2 ~ /^îáú÷áîéå/ || $2 ~ /^Ãû³Æ/ || $2 ~ /^¦WºÙ/ ||
$2 ~ /^NOME/ || $2 ~ /^NAAM/) || $2 ~ /^ÈÌÅ/)) ||
(pages == "cat" && $1 ~ /^NAME/)) {
if (!insh) {
insh = 1;
} else {
done = 1;
}
} else if (insh) {
if ($1 ~ /^\.[Ss][HhYS]/ ||
(pages == "cat" &&
($1 ~ /^S[yYeE]/ || $1 ~ /^DESCRIPTION/ ||
$1 ~ /^COMMAND/ || $1 ~ /^OVERVIEW/ ||
$1 ~ /^STRUCTURES/ || $1 ~ /^INTRODUCTION/ ||
$0 ~ /^[^ ]/))) {
# end insh for Synopsis, Syntax, but also for
# DESCRIPTION (e.g., XFree86.1x),
# COMMAND (e.g., xspread.1)
# OVERVIEW (e.g., TclCommandWriting.3)
# STRUCTURES (e.g., XEvent.3x)
# INTRODUCTION (e.g., TclX.n)
# and anything at all that begins in Column 1, so
# is probably a section header.
done = 1;
} else {
if ($0 ~ progname"-") { # Fix old cat pages
sub(progname"-", progname" - ");
}
if ($0 ~ /[^ \\]-$/) {
sub(/-$/, ""); # Handle Hyphenations
nextjoin = 1;
} else if ($0 ~ /\\c$/) {
sub(/\\c$/, ""); # Handle Continuations
nextjoin = 1;
} else
nextjoin = 0;
sub(/^.[IB] /, ""); # Kill bold and italics
sub(/^.BI /, ""); #
sub(/^.SM /, ""); # Kill small
sub(/^.Nm /, ""); # Kill bold
sub(/^.Tn /, ""); # Kill normal
sub(/^.Li /, ""); # Kill .Li
sub(/^.Dq /, ""); # Kill .Dq
sub(/^.Nd */, "- "); # Convert .Nd to dash
sub(/\\\".*/, ""); # Trim pending comments
sub(/ *$/, ""); # Trim pending spaces
sub(/^\.$/, ""); # Kill blank comments
sub(/^'.*/, ""); # Kill comment/troff lines
sub(/^.in .*/, ""); # Kill various macros
sub(/^.ti .*/, "");
sub(/^.ta .*/, "");
sub(/^.Vb .*/, "");
sub(/^.[PLTH]P$/, ""); # .PP/.LP/.TP/.HP
sub(/^.Pp$/, "");
sub(/^.[iI]X .*$/, "");
sub(/^.nolinks$/, "");
sub(/^.B$/, "");
sub(/^.nf$/, "");
if (($1 ~ /^\.../ || $1 == "") &&
(entire_line ~ / - / || entire_line ~ / \\- /)) {
# Assume that this ends the description of one line
# Sometimes there are several descriptions in one page,
# as in outb(2).
handle_entire_line();
entire_line = "";
thisjoin = 1;
} else {
if (thisjoin) {
entire_line = entire_line $0;
} else {
entire_line = entire_line " " $0;
}
thisjoin = nextjoin;
}
}
}
}
handle_entire_line();
closeline();
}
function handle_entire_line() {
x = entire_line; # Keep it short
gsub(/\015/, "", x); # Kill DOS remains
gsub(/ /, " ", x); # Translate tabs to spaces
gsub(/ +/, " ", x); # Collapse spaces
gsub(/ *, */, ", ", x); # Fix comma spacings
sub(/^ /, "", x); # Kill initial spaces
sub(/ $/, "", x); # Kill trailing spaces
sub(/__+/, "_", x); # Collapse underscores
gsub(/\\f\(../, "", x); # Kill font changes
gsub(/\\f[PRIB0123]/, "", x); # Kill font changes
gsub(/\\s[-+0-9]*/, "", x); # Kill size changes
gsub(/\\&/, "", x); # Kill \&
gsub(/\\\|/, "", x); # Kill \|
gsub(/\\\((ru|ul)/, "_", x); # Translate
gsub(/\\\((mi|hy|em)/, "-", x); # Translate
gsub(/\\\*\(../, "", x); # Kill troff strings
gsub(/\\/, "", x); # Kill all backslashes
gsub(/"/, "", x); # Kill quotes (from .Nd "foo bar")
sub(/<h1 align=center>/, "", x);# Yuk! HTML cruft
gsub(/\000.*/, "X", x); # Binary cruft in LAPACK pages
gsub(/ +/, " ", x); # Collapse spaces (again)
sub(/^ /, "", x); # Kill initial spaces (again)
sub(/ $/, "", x); # Kill trailing spaces (again)
sub(/\.$/, "", x); # Kill trailing period
if (!match(x, / - /))
return;
after_dash = substr(x, RSTART);
head = substr(x, 1, RSTART-1) ", ";
while (match(head, /, /)) {
prog = substr(head, 1, RSTART-1);
head = substr(head, RSTART+2);
if (prog != progname)
prog = prog " [" progname "]";
printf "%-*s (%s) %s\n", 20, prog, actual_section, after_dash;
}
}
{ # Main action - process each filename read in.
filename = $0;
do_one();
}
pages=man section=5 verbose= curdir=/usr/local/man/man5
awk: line 74: syntax error at or near ||
awk: line 75: extra ')'
awk: line 78: syntax error at or near else
awk: line 81: syntax error at or near }
awk: line 151: syntax error at or near }
+ find /usr/local/man/man5/. -name * -type f -size +0 -ctime 0 -print
+ cd ..
+ [ -d man6 ]
+ cd man6
+ section=6
+ curdir=/usr/local/man/man6
+ export section verbose curdir
+ find /usr/local/man/man6/. -name * -type f -size +0 -ctime 0 -print
+ /bin/awk
function readline() {
if (use_zcat || use_bzcat) {
result = (pipe_cmd | getline);
if (result < 0) {
print "Pipe error: " pipe_cmd " " ERRNO > "/dev/stderr";
}
} else {
result = (getline < filename);
if (result < 0) {
print "Read file error: " filename " " ERRNO > "/dev/stderr";
}
}
return result;
}
function closeline() {
if (use_zcat || use_bzcat) {
return close(pipe_cmd);
} else {
return close(filename);
}
}
function do_one() {
insh = 0; thisjoin = 1; done = 0;
entire_line = "";
if (verbose) {
print "adding " filename > "/dev/stderr"
}
use_zcat = match(filename,"\\.Z$") ||
match(filename,"\\.z$") || match(filename,"\\.gz$");
if (!use_zcat)
use_bzcat = match(filename,"\\.bz2");
if (use_zcat || use_bzcat) {
filename_no_gz = substr(filename, 0, RSTART - 1);
} else {
filename_no_gz = filename;
}
match(filename_no_gz, "/[^/]+$");
progname = substr(filename, RSTART + 1, RLENGTH - 1);
if (match(progname, "\\." section "[A-Za-z]+")) {
actual_section = substr(progname, RSTART + 1, RLENGTH - 1);
} else {
actual_section = section;
}
sub(/\..*/, "", progname);
if (use_zcat || use_bzcat) {
if (use_zcat) {
pipe_cmd = "zcat \"" filename "\"";
} else {
pipe_cmd = "bzcat \"" filename "\"";
}
# try to avoid suspicious stuff
if (filename ~ /[;&|`$(]/) {
print "ignored strange file name " filename " in " curdir > "/dev/stderr";
return;
}
}
while (!done && readline() > 0) {
gsub(/.\b/, "");
if (($1 ~ /^\.[Ss][Hh]/ &&
($2 ~ /[Nn][Aa][Mm][Ee]/ ||
$2 ~ /^JMÉNO/ || $2 ~ /^NAVN/ || $2 ~ /^NUME/ ||
$2 ~ /^BEZEICHNUNG/ || $2 ~ /^NOMBRE/ ||
$2 ~ /^NIMI/ || $2 ~ /^NOM/ || $2 ~ /^IME/ ||
$2 ~ /^N[ÉE]V/ || $2 ~ /^NAMA/ || $2 ~ /^̾Á°/ ||
$2 ~ /^̾¾Î/ || $2 ~ /^À̸§/ || $2 ~ /^NAZWA/ ||
$2 ~ /^îáú÷áîéå/ || $2 ~ /^Ãû³Æ/ || $2 ~ /^¦WºÙ/ ||
$2 ~ /^NOME/ || $2 ~ /^NAAM/) || $2 ~ /^ÈÌÅ/)) ||
(pages == "cat" && $1 ~ /^NAME/)) {
if (!insh) {
insh = 1;
} else {
done = 1;
}
} else if (insh) {
if ($1 ~ /^\.[Ss][HhYS]/ ||
(pages == "cat" &&
($1 ~ /^S[yYeE]/ || $1 ~ /^DESCRIPTION/ ||
$1 ~ /^COMMAND/ || $1 ~ /^OVERVIEW/ ||
$1 ~ /^STRUCTURES/ || $1 ~ /^INTRODUCTION/ ||
$0 ~ /^[^ ]/))) {
# end insh for Synopsis, Syntax, but also for
# DESCRIPTION (e.g., XFree86.1x),
# COMMAND (e.g., xspread.1)
# OVERVIEW (e.g., TclCommandWriting.3)
# STRUCTURES (e.g., XEvent.3x)
# INTRODUCTION (e.g., TclX.n)
# and anything at all that begins in Column 1, so
# is probably a section header.
done = 1;
} else {
if ($0 ~ progname"-") { # Fix old cat pages
sub(progname"-", progname" - ");
}
if ($0 ~ /[^ \\]-$/) {
sub(/-$/, ""); # Handle Hyphenations
nextjoin = 1;
} else if ($0 ~ /\\c$/) {
sub(/\\c$/, ""); # Handle Continuations
nextjoin = 1;
} else
nextjoin = 0;
sub(/^.[IB] /, ""); # Kill bold and italics
sub(/^.BI /, ""); #
sub(/^.SM /, ""); # Kill small
sub(/^.Nm /, ""); # Kill bold
sub(/^.Tn /, ""); # Kill normal
sub(/^.Li /, ""); # Kill .Li
sub(/^.Dq /, ""); # Kill .Dq
sub(/^.Nd */, "- "); # Convert .Nd to dash
sub(/\\\".*/, ""); # Trim pending comments
sub(/ *$/, ""); # Trim pending spaces
sub(/^\.$/, ""); # Kill blank comments
sub(/^'.*/, ""); # Kill comment/troff lines
sub(/^.in .*/, ""); # Kill various macros
sub(/^.ti .*/, "");
sub(/^.ta .*/, "");
sub(/^.Vb .*/, "");
sub(/^.[PLTH]P$/, ""); # .PP/.LP/.TP/.HP
sub(/^.Pp$/, "");
sub(/^.[iI]X .*$/, "");
sub(/^.nolinks$/, "");
sub(/^.B$/, "");
sub(/^.nf$/, "");
if (($1 ~ /^\.../ || $1 == "") &&
(entire_line ~ / - / || entire_line ~ / \\- /)) {
# Assume that this ends the description of one line
# Sometimes there are several descriptions in one page,
# as in outb(2).
handle_entire_line();
entire_line = "";
thisjoin = 1;
} else {
if (thisjoin) {
entire_line = entire_line $0;
} else {
entire_line = entire_line " " $0;
}
thisjoin = nextjoin;
}
}
}
}
handle_entire_line();
closeline();
}
function handle_entire_line() {
x = entire_line; # Keep it short
gsub(/\015/, "", x); # Kill DOS remains
gsub(/ /, " ", x); # Translate tabs to spaces
gsub(/ +/, " ", x); # Collapse spaces
gsub(/ *, */, ", ", x); # Fix comma spacings
sub(/^ /, "", x); # Kill initial spaces
sub(/ $/, "", x); # Kill trailing spaces
sub(/__+/, "_", x); # Collapse underscores
gsub(/\\f\(../, "", x); # Kill font changes
gsub(/\\f[PRIB0123]/, "", x); # Kill font changes
gsub(/\\s[-+0-9]*/, "", x); # Kill size changes
gsub(/\\&/, "", x); # Kill \&
gsub(/\\\|/, "", x); # Kill \|
gsub(/\\\((ru|ul)/, "_", x); # Translate
gsub(/\\\((mi|hy|em)/, "-", x); # Translate
gsub(/\\\*\(../, "", x); # Kill troff strings
gsub(/\\/, "", x); # Kill all backslashes
gsub(/"/, "", x); # Kill quotes (from .Nd "foo bar")
sub(/<h1 align=center>/, "", x);# Yuk! HTML cruft
gsub(/\000.*/, "X", x); # Binary cruft in LAPACK pages
gsub(/ +/, " ", x); # Collapse spaces (again)
sub(/^ /, "", x); # Kill initial spaces (again)
sub(/ $/, "", x); # Kill trailing spaces (again)
sub(/\.$/, "", x); # Kill trailing period
if (!match(x, / - /))
return;
after_dash = substr(x, RSTART);
head = substr(x, 1, RSTART-1) ", ";
while (match(head, /, /)) {
prog = substr(head, 1, RSTART-1);
head = substr(head, RSTART+2);
if (prog != progname)
prog = prog " [" progname "]";
printf "%-*s (%s) %s\n", 20, prog, actual_section, after_dash;
}
}
{ # Main action - process each filename read in.
filename = $0;
do_one();
}
pages=man section=6 verbose= curdir=/usr/local/man/man6
awk: line 74: syntax error at or near ||
awk: line 75: extra ')'
awk: line 78: syntax error at or near else
awk: line 81: syntax error at or near }
awk: line 151: syntax error at or near }
+ cd ..
+ [ -d man7 ]
+ cd man7
+ section=7
+ curdir=/usr/local/man/man7
+ export section verbose curdir
+ find /usr/local/man/man7/. -name * -type f -size +0 -ctime 0 -print
+ /bin/awk
function readline() {
if (use_zcat || use_bzcat) {
result = (pipe_cmd | getline);
if (result < 0) {
print "Pipe error: " pipe_cmd " " ERRNO > "/dev/stderr";
}
} else {
result = (getline < filename);
if (result < 0) {
print "Read file error: " filename " " ERRNO > "/dev/stderr";
}
}
return result;
}
function closeline() {
if (use_zcat || use_bzcat) {
return close(pipe_cmd);
} else {
return close(filename);
}
}
function do_one() {
insh = 0; thisjoin = 1; done = 0;
entire_line = "";
if (verbose) {
print "adding " filename > "/dev/stderr"
}
use_zcat = match(filename,"\\.Z$") ||
match(filename,"\\.z$") || match(filename,"\\.gz$");
if (!use_zcat)
use_bzcat = match(filename,"\\.bz2");
if (use_zcat || use_bzcat) {
filename_no_gz = substr(filename, 0, RSTART - 1);
} else {
filename_no_gz = filename;
}
match(filename_no_gz, "/[^/]+$");
progname = substr(filename, RSTART + 1, RLENGTH - 1);
if (match(progname, "\\." section "[A-Za-z]+")) {
actual_section = substr(progname, RSTART + 1, RLENGTH - 1);
} else {
actual_section = section;
}
sub(/\..*/, "", progname);
if (use_zcat || use_bzcat) {
if (use_zcat) {
pipe_cmd = "zcat \"" filename "\"";
} else {
pipe_cmd = "bzcat \"" filename "\"";
}
# try to avoid suspicious stuff
if (filename ~ /[;&|`$(]/) {
print "ignored strange file name " filename " in " curdir > "/dev/stderr";
return;
}
}
while (!done && readline() > 0) {
gsub(/.\b/, "");
if (($1 ~ /^\.[Ss][Hh]/ &&
($2 ~ /[Nn][Aa][Mm][Ee]/ ||
$2 ~ /^JMÉNO/ || $2 ~ /^NAVN/ || $2 ~ /^NUME/ ||
$2 ~ /^BEZEICHNUNG/ || $2 ~ /^NOMBRE/ ||
$2 ~ /^NIMI/ || $2 ~ /^NOM/ || $2 ~ /^IME/ ||
$2 ~ /^N[ÉE]V/ || $2 ~ /^NAMA/ || $2 ~ /^̾Á°/ ||
$2 ~ /^̾¾Î/ || $2 ~ /^À̸§/ || $2 ~ /^NAZWA/ ||
$2 ~ /^îáú÷áîéå/ || $2 ~ /^Ãû³Æ/ || $2 ~ /^¦WºÙ/ ||
$2 ~ /^NOME/ || $2 ~ /^NAAM/) || $2 ~ /^ÈÌÅ/)) ||
(pages == "cat" && $1 ~ /^NAME/)) {
if (!insh) {
insh = 1;
} else {
done = 1;
}
} else if (insh) {
if ($1 ~ /^\.[Ss][HhYS]/ ||
(pages == "cat" &&
($1 ~ /^S[yYeE]/ || $1 ~ /^DESCRIPTION/ ||
$1 ~ /^COMMAND/ || $1 ~ /^OVERVIEW/ ||
$1 ~ /^STRUCTURES/ || $1 ~ /^INTRODUCTION/ ||
$0 ~ /^[^ ]/))) {
# end insh for Synopsis, Syntax, but also for
# DESCRIPTION (e.g., XFree86.1x),
# COMMAND (e.g., xspread.1)
# OVERVIEW (e.g., TclCommandWriting.3)
# STRUCTURES (e.g., XEvent.3x)
# INTRODUCTION (e.g., TclX.n)
# and anything at all that begins in Column 1, so
# is probably a section header.
done = 1;
} else {
if ($0 ~ progname"-") { # Fix old cat pages
sub(progname"-", progname" - ");
}
if ($0 ~ /[^ \\]-$/) {
sub(/-$/, ""); # Handle Hyphenations
nextjoin = 1;
} else if ($0 ~ /\\c$/) {
sub(/\\c$/, ""); # Handle Continuations
nextjoin = 1;
} else
nextjoin = 0;
sub(/^.[IB] /, ""); # Kill bold and italics
sub(/^.BI /, ""); #
sub(/^.SM /, ""); # Kill small
sub(/^.Nm /, ""); # Kill bold
sub(/^.Tn /, ""); # Kill normal
sub(/^.Li /, ""); # Kill .Li
sub(/^.Dq /, ""); # Kill .Dq
sub(/^.Nd */, "- "); # Convert .Nd to dash
sub(/\\\".*/, ""); # Trim pending comments
sub(/ *$/, ""); # Trim pending spaces
sub(/^\.$/, ""); # Kill blank comments
sub(/^'.*/, ""); # Kill comment/troff lines
sub(/^.in .*/, ""); # Kill various macros
sub(/^.ti .*/, "");
sub(/^.ta .*/, "");
sub(/^.Vb .*/, "");
sub(/^.[PLTH]P$/, ""); # .PP/.LP/.TP/.HP
sub(/^.Pp$/, "");
sub(/^.[iI]X .*$/, "");
sub(/^.nolinks$/, "");
sub(/^.B$/, "");
sub(/^.nf$/, "");
if (($1 ~ /^\.../ || $1 == "") &&
(entire_line ~ / - / || entire_line ~ / \\- /)) {
# Assume that this ends the description of one line
# Sometimes there are several descriptions in one page,
# as in outb(2).
handle_entire_line();
entire_line = "";
thisjoin = 1;
} else {
if (thisjoin) {
entire_line = entire_line $0;
} else {
entire_line = entire_line " " $0;
}
thisjoin = nextjoin;
}
}
}
}
handle_entire_line();
closeline();
}
function handle_entire_line() {
x = entire_line; # Keep it short
gsub(/\015/, "", x); # Kill DOS remains
gsub(/ /, " ", x); # Translate tabs to spaces
gsub(/ +/, " ", x); # Collapse spaces
gsub(/ *, */, ", ", x); # Fix comma spacings
sub(/^ /, "", x); # Kill initial spaces
sub(/ $/, "", x); # Kill trailing spaces
sub(/__+/, "_", x); # Collapse underscores
gsub(/\\f\(../, "", x); # Kill font changes
gsub(/\\f[PRIB0123]/, "", x); # Kill font changes
gsub(/\\s[-+0-9]*/, "", x); # Kill size changes
gsub(/\\&/, "", x); # Kill \&
gsub(/\\\|/, "", x); # Kill \|
gsub(/\\\((ru|ul)/, "_", x); # Translate
gsub(/\\\((mi|hy|em)/, "-", x); # Translate
gsub(/\\\*\(../, "", x); # Kill troff strings
gsub(/\\/, "", x); # Kill all backslashes
gsub(/"/, "", x); # Kill quotes (from .Nd "foo bar")
sub(/<h1 align=center>/, "", x);# Yuk! HTML cruft
gsub(/\000.*/, "X", x); # Binary cruft in LAPACK pages
gsub(/ +/, " ", x); # Collapse spaces (again)
sub(/^ /, "", x); # Kill initial spaces (again)
sub(/ $/, "", x); # Kill trailing spaces (again)
sub(/\.$/, "", x); # Kill trailing period
if (!match(x, / - /))
return;
after_dash = substr(x, RSTART);
head = substr(x, 1, RSTART-1) ", ";
while (match(head, /, /)) {
prog = substr(head, 1, RSTART-1);
head = substr(head, RSTART+2);
if (prog != progname)
prog = prog " [" progname "]";
printf "%-*s (%s) %s\n", 20, prog, actual_section, after_dash;
}
}
{ # Main action - process each filename read in.
filename = $0;
do_one();
}
pages=man section=7 verbose= curdir=/usr/local/man/man7
awk: line 74: syntax error at or near ||
awk: line 75: extra ')'
awk: line 78: syntax error at or near else
awk: line 81: syntax error at or near }
awk: line 151: syntax error at or near }
+ cd ..
+ [ -d man8 ]
+ cd man8
+ section=8
+ curdir=/usr/local/man/man8
+ export section verbose curdir
+ find /usr/local/man/man8/. -name * -type f -size +0 -ctime 0 -print
+ /bin/awk
function readline() {
if (use_zcat || use_bzcat) {
result = (pipe_cmd | getline);
if (result < 0) {
print "Pipe error: " pipe_cmd " " ERRNO > "/dev/stderr";
}
} else {
result = (getline < filename);
if (result < 0) {
print "Read file error: " filename " " ERRNO > "/dev/stderr";
}
}
return result;
}
function closeline() {
if (use_zcat || use_bzcat) {
return close(pipe_cmd);
} else {
return close(filename);
}
}
function do_one() {
insh = 0; thisjoin = 1; done = 0;
entire_line = "";
if (verbose) {
print "adding " filename > "/dev/stderr"
}
use_zcat = match(filename,"\\.Z$") ||
match(filename,"\\.z$") || match(filename,"\\.gz$");
if (!use_zcat)
use_bzcat = match(filename,"\\.bz2");
if (use_zcat || use_bzcat) {
filename_no_gz = substr(filename, 0, RSTART - 1);
} else {
filename_no_gz = filename;
}
match(filename_no_gz, "/[^/]+$");
progname = substr(filename, RSTART + 1, RLENGTH - 1);
if (match(progname, "\\." section "[A-Za-z]+")) {
actual_section = substr(progname, RSTART + 1, RLENGTH - 1);
} else {
actual_section = section;
}
sub(/\..*/, "", progname);
if (use_zcat || use_bzcat) {
if (use_zcat) {
pipe_cmd = "zcat \"" filename "\"";
} else {
pipe_cmd = "bzcat \"" filename "\"";
}
# try to avoid suspicious stuff
if (filename ~ /[;&|`$(]/) {
print "ignored strange file name " filename " in " curdir > "/dev/stderr";
return;
}
}
while (!done && readline() > 0) {
gsub(/.\b/, "");
if (($1 ~ /^\.[Ss][Hh]/ &&
($2 ~ /[Nn][Aa][Mm][Ee]/ ||
$2 ~ /^JMÉNO/ || $2 ~ /^NAVN/ || $2 ~ /^NUME/ ||
$2 ~ /^BEZEICHNUNG/ || $2 ~ /^NOMBRE/ ||
$2 ~ /^NIMI/ || $2 ~ /^NOM/ || $2 ~ /^IME/ ||
$2 ~ /^N[ÉE]V/ || $2 ~ /^NAMA/ || $2 ~ /^̾Á°/ ||
$2 ~ /^̾¾Î/ || $2 ~ /^À̸§/ || $2 ~ /^NAZWA/ ||
$2 ~ /^îáú÷áîéå/ || $2 ~ /^Ãû³Æ/ || $2 ~ /^¦WºÙ/ ||
$2 ~ /^NOME/ || $2 ~ /^NAAM/) || $2 ~ /^ÈÌÅ/)) ||
(pages == "cat" && $1 ~ /^NAME/)) {
if (!insh) {
insh = 1;
} else {
done = 1;
}
} else if (insh) {
if ($1 ~ /^\.[Ss][HhYS]/ ||
(pages == "cat" &&
($1 ~ /^S[yYeE]/ || $1 ~ /^DESCRIPTION/ ||
$1 ~ /^COMMAND/ || $1 ~ /^OVERVIEW/ ||
$1 ~ /^STRUCTURES/ || $1 ~ /^INTRODUCTION/ ||
$0 ~ /^[^ ]/))) {
# end insh for Synopsis, Syntax, but also for
# DESCRIPTION (e.g., XFree86.1x),
# COMMAND (e.g., xspread.1)
# OVERVIEW (e.g., TclCommandWriting.3)
# STRUCTURES (e.g., XEvent.3x)
# INTRODUCTION (e.g., TclX.n)
# and anything at all that begins in Column 1, so
# is probably a section header.
done = 1;
} else {
if ($0 ~ progname"-") { # Fix old cat pages
sub(progname"-", progname" - ");
}
if ($0 ~ /[^ \\]-$/) {
sub(/-$/, ""); # Handle Hyphenations
nextjoin = 1;
} else if ($0 ~ /\\c$/) {
sub(/\\c$/, ""); # Handle Continuations
nextjoin = 1;
} else
nextjoin = 0;
sub(/^.[IB] /, ""); # Kill bold and italics
sub(/^.BI /, ""); #
sub(/^.SM /, ""); # Kill small
sub(/^.Nm /, ""); # Kill bold
sub(/^.Tn /, ""); # Kill normal
sub(/^.Li /, ""); # Kill .Li
sub(/^.Dq /, ""); # Kill .Dq
sub(/^.Nd */, "- "); # Convert .Nd to dash
sub(/\\\".*/, ""); # Trim pending comments
sub(/ *$/, ""); # Trim pending spaces
sub(/^\.$/, ""); # Kill blank comments
sub(/^'.*/, ""); # Kill comment/troff lines
sub(/^.in .*/, ""); # Kill various macros
sub(/^.ti .*/, "");
sub(/^.ta .*/, "");
sub(/^.Vb .*/, "");
sub(/^.[PLTH]P$/, ""); # .PP/.LP/.TP/.HP
sub(/^.Pp$/, "");
sub(/^.[iI]X .*$/, "");
sub(/^.nolinks$/, "");
sub(/^.B$/, "");
sub(/^.nf$/, "");
if (($1 ~ /^\.../ || $1 == "") &&
(entire_line ~ / - / || entire_line ~ / \\- /)) {
# Assume that this ends the description of one line
# Sometimes there are several descriptions in one page,
# as in outb(2).
handle_entire_line();
entire_line = "";
thisjoin = 1;
} else {
if (thisjoin) {
entire_line = entire_line $0;
} else {
entire_line = entire_line " " $0;
}
thisjoin = nextjoin;
}
}
}
}
handle_entire_line();
closeline();
}
function handle_entire_line() {
x = entire_line; # Keep it short
gsub(/\015/, "", x); # Kill DOS remains
gsub(/ /, " ", x); # Translate tabs to spaces
gsub(/ +/, " ", x); # Collapse spaces
gsub(/ *, */, ", ", x); # Fix comma spacings
sub(/^ /, "", x); # Kill initial spaces
sub(/ $/, "", x); # Kill trailing spaces
sub(/__+/, "_", x); # Collapse underscores
gsub(/\\f\(../, "", x); # Kill font changes
gsub(/\\f[PRIB0123]/, "", x); # Kill font changes
gsub(/\\s[-+0-9]*/, "", x); # Kill size changes
gsub(/\\&/, "", x); # Kill \&
gsub(/\\\|/, "", x); # Kill \|
gsub(/\\\((ru|ul)/, "_", x); # Translate
gsub(/\\\((mi|hy|em)/, "-", x); # Translate
gsub(/\\\*\(../, "", x); # Kill troff strings
gsub(/\\/, "", x); # Kill all backslashes
gsub(/"/, "", x); # Kill quotes (from .Nd "foo bar")
sub(/<h1 align=center>/, "", x);# Yuk! HTML cruft
gsub(/\000.*/, "X", x); # Binary cruft in LAPACK pages
gsub(/ +/, " ", x); # Collapse spaces (again)
sub(/^ /, "", x); # Kill initial spaces (again)
sub(/ $/, "", x); # Kill trailing spaces (again)
sub(/\.$/, "", x); # Kill trailing period
if (!match(x, / - /))
return;
after_dash = substr(x, RSTART);
head = substr(x, 1, RSTART-1) ", ";
while (match(head, /, /)) {
prog = substr(head, 1, RSTART-1);
head = substr(head, RSTART+2);
if (prog != progname)
prog = prog " [" progname "]";
printf "%-*s (%s) %s\n", 20, prog, actual_section, after_dash;
}
}
{ # Main action - process each filename read in.
filename = $0;
do_one();
}
pages=man section=8 verbose= curdir=/usr/local/man/man8
awk: line 74: syntax error at or near ||
awk: line 75: extra ')'
awk: line 78: syntax error at or near else
awk: line 81: syntax error at or near }
awk: line 151: syntax error at or near }
+ cd ..
+ [ -d man9 ]
+ [ -d mann ]
+ [ -d manl ]
+ cd /tmp
+ mandir1=/usr/local/man
+ [ x != x ]
+ [ -s /usr/local/man/whatis ]
+ tr -s \n
+ < /var/tmp/tmpwhatisrhNeCA/w
+ sort -u
+ > /usr/local/man/whatis
+ chmod 644 /usr/local/man/whatis
+ rm /var/tmp/tmpwhatisrhNeCA/w
+ export pages
+ eval path=$catpath
+ path=/usr/share/man /usr/X11R6/man /usr/local/share/man /usr/local/man
+ [ x != x ]
+ [ -s /usr/share/man/whatis -a cat = man -a x1 = x ]
+ pwd
+ here=/tmp
+ cd /usr/share/man
+ > /var/tmp/tmpwhatisrhNeCA/w
+ [ -d cat1 ]
+ [ -d cat2 ]
+ [ -d cat3 ]
+ [ -d cat4 ]
+ [ -d cat5 ]
+ [ -d cat6 ]
+ [ -d cat7 ]
+ [ -d cat8 ]
+ [ -d cat9 ]
+ [ -d catn ]
+ [ -d catl ]
+ cd /tmp
+ mandir1=/usr/share/man
+ [ x != x ]
+ [ -s /usr/share/man/whatis ]
+ tr -s \n
+ < /var/tmp/tmpwhatisrhNeCA/w
+ sort -u
+ > /usr/share/man/whatis
+ chmod 644 /usr/share/man/whatis
+ rm /var/tmp/tmpwhatisrhNeCA/w
+ [ x != x ]
+ [ -s /usr/X11R6/man/whatis -a cat = man -a x1 = x ]
+ pwd
+ here=/tmp
+ cd /usr/X11R6/man
+ > /var/tmp/tmpwhatisrhNeCA/w
+ [ -d cat1 ]
+ [ -d cat2 ]
+ [ -d cat3 ]
+ [ -d cat4 ]
+ [ -d cat5 ]
+ [ -d cat6 ]
+ [ -d cat7 ]
+ [ -d cat8 ]
+ [ -d cat9 ]
+ [ -d catn ]
+ [ -d catl ]
+ cd /tmp
+ mandir1=/usr/X11R6/man
+ [ x != x ]
+ [ -s /usr/X11R6/man/whatis ]
+ tr -s \n
+ < /var/tmp/tmpwhatisrhNeCA/w
+ sort -u
+ > /usr/X11R6/man/whatis
+ chmod 644 /usr/X11R6/man/whatis
+ rm /var/tmp/tmpwhatisrhNeCA/w
+ [ x != x ]
+ [ -s /usr/local/share/man/whatis -a cat = man -a x1 = x ]
+ pwd
+ here=/tmp
+ cd /usr/local/share/man
+ > /var/tmp/tmpwhatisrhNeCA/w
+ [ -d cat1 ]
+ [ -d cat2 ]
+ [ -d cat3 ]
+ [ -d cat4 ]
+ [ -d cat5 ]
+ [ -d cat6 ]
+ [ -d cat7 ]
+ [ -d cat8 ]
+ [ -d cat9 ]
+ [ -d catn ]
+ [ -d catl ]
+ cd /tmp
+ mandir1=/usr/local/share/man
+ [ x != x ]
+ [ -s /usr/local/share/man/whatis ]
+ tr -s \n
+ < /var/tmp/tmpwhatisrhNeCA/w
+ sort -u
+ > /usr/local/share/man/whatis
+ chmod 644 /usr/local/share/man/whatis
+ rm /var/tmp/tmpwhatisrhNeCA/w
+ [ x != x ]
+ [ -s /usr/local/man/whatis -a cat = man -a x1 = x ]
+ pwd
+ here=/tmp
+ cd /usr/local/man
+ > /var/tmp/tmpwhatisrhNeCA/w
+ [ -d cat1 ]
+ [ -d cat2 ]
+ [ -d cat3 ]
+ [ -d cat4 ]
+ [ -d cat5 ]
+ [ -d cat6 ]
+ [ -d cat7 ]
+ [ -d cat8 ]
+ [ -d cat9 ]
+ [ -d catn ]
+ [ -d catl ]
+ cd /tmp
+ mandir1=/usr/local/man
+ [ x != x ]
+ [ -s /usr/local/man/whatis ]
+ tr -s \n
+ < /var/tmp/tmpwhatisrhNeCA/w
+ sort -u
+ > /usr/local/man/whatis
+ chmod 644 /usr/local/man/whatis
+ rm /var/tmp/tmpwhatisrhNeCA/w
+ rm -rf /var/tmp/tmpwhatisrhNeCA
+ rm -rf /var/tmp/tmpwhatisrhNeCA
_wintersunset-root:/tmp\[32m12:41:55[0m root[[35mpts/7[0m]@wintersunset /tmp[36m#[0m [K
Script done on Thu Feb 9 12:41:56 2006
More information about the pld-devel-en
mailing list