From dbdb3b9fcf11946932f60c9855956a000262b2d5 Mon Sep 17 00:00:00 2001 From: rmax Date: Thu, 18 Nov 2004 18:30:28 +0000 Subject: some seds don't support comments :( --- unix/installManPage | 29 +++++++++++++++++++++-------- 1 file 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` -- cgit v0.12