summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrmax <rmax>2004-11-18 18:08:27 (GMT)
committerrmax <rmax>2004-11-18 18:08:27 (GMT)
commit00ad26eafa50df0cac88d16739938aa9e88b446f (patch)
tree71d98f6d453fc9cb803e739e94d73073e9b001f6
parente74b7a8c45db6c1058bd6f60f61e78778640a866 (diff)
downloadtcl-00ad26eafa50df0cac88d16739938aa9e88b446f.zip
tcl-00ad26eafa50df0cac88d16739938aa9e88b446f.tar.gz
tcl-00ad26eafa50df0cac88d16739938aa9e88b446f.tar.bz2
Arghh - some seds don't even support comments at all.
-rwxr-xr-xunix/installManPage29
1 files changed, 21 insertions, 8 deletions
diff --git a/unix/installManPage b/unix/installManPage
index 8045423..4157d26 100755
--- a/unix/installManPage
+++ b/unix/installManPage
@@ -20,15 +20,28 @@ MANPAGE=$1
DIR=$2
test -z "$S" && S="$DIR/"
-# Backslashes are trippled in the sed script, because it is in backticks
-# which don't pass backslashes literally.
+# A sed script to parse the alternative names out of a man page.
+#
+# /^\\.SH NAME/{ ;# Look for a line, that starts with .SH NAME
+# s/^.*$// ;# Delete the content of this line from the buffer
+# n ;# Read next line
+# s/,\|\\\ //g ;# Remove all commas
+# s/ \\\-.*// ;# Delete from \- to the end of line
+# p ;# print the result
+# q ;# exit
+#
+# Backslashes are trippled in the sed script, because it is in
+# backticks which don't pass backslashes literally.
+#
+# Please keep the commented version above updated if you
+# change anything to the script below.
NAMES=`sed -n '
- /^\\.SH NAME/{ ;# Look for a line, that starts with .SH NAME
- s/^.*$// ;# Delete the content of this line from the buffer
- n ;# Read next line
- s/,\|\\\ //g ;# Remove all commas
- s/ \\\-.*// ;# Delete from \- to the end of line
- p ;# print the result
+ /^\\.SH NAME/{
+ s/^.*$//
+ n
+ s/,\|\\\ //g
+ s/ \\\-.*//
+ p
q
}' $MANPAGE`