summaryrefslogtreecommitdiffstats
path: root/unix/installManPage
diff options
context:
space:
mode:
authorrmax <rmax>2004-11-18 18:33:34 (GMT)
committerrmax <rmax>2004-11-18 18:33:34 (GMT)
commit8089e65698a95a5d029d57edd066a0c23525acd7 (patch)
treec4cd431565a6dbfc66a5870dcd13284cca930f9b /unix/installManPage
parent8949d2b1015b366db8e41325e10beef68e866a83 (diff)
downloadtk-8089e65698a95a5d029d57edd066a0c23525acd7.zip
tk-8089e65698a95a5d029d57edd066a0c23525acd7.tar.gz
tk-8089e65698a95a5d029d57edd066a0c23525acd7.tar.bz2
some seds don't support comments :(
Diffstat (limited to 'unix/installManPage')
-rwxr-xr-xunix/installManPage29
1 files changed, 21 insertions, 8 deletions
diff --git a/unix/installManPage b/unix/installManPage
index 16cf005..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`