]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - man/make_sed.sh
ncurses 6.2 - patch 20210109
[ncurses.git] / man / make_sed.sh
index c6c37c25b0d55d96ac6b129dcf193c5b8a96f3bd..92e35eb27e60d7a8f6a90064dbb0ad9a877c4bf5 100755 (executable)
@@ -1,7 +1,8 @@
 #!/bin/sh
 #!/bin/sh
-# $Id: make_sed.sh,v 1.5 1998/02/11 12:13:48 tom Exp $
+# $Id: make_sed.sh,v 1.11 2020/02/02 23:34:34 tom Exp $
 ##############################################################################
 ##############################################################################
-# Copyright (c) 1998 Free Software Foundation, Inc.                          #
+# Copyright 2020 Thomas E. Dickey                                            #
+# Copyright 1998-2005,2017 Free Software Foundation, Inc.                    #
 #                                                                            #
 # Permission is hereby granted, free of charge, to any person obtaining a    #
 # copy of this software and associated documentation files (the "Software"), #
 #                                                                            #
 # Permission is hereby granted, free of charge, to any person obtaining a    #
 # copy of this software and associated documentation files (the "Software"), #
@@ -28,7 +29,7 @@
 # authorization.                                                             #
 ##############################################################################
 #
 # authorization.                                                             #
 ##############################################################################
 #
-# Author: Thomas E. Dickey <dickey@clark.net> 1997
+# Author: Thomas E. Dickey 1997-2005
 #
 # Construct a sed-script to perform renaming within man-pages.  Originally
 # written in much simpler form, this one accounts for the common cases of
 #
 # Construct a sed-script to perform renaming within man-pages.  Originally
 # written in much simpler form, this one accounts for the common cases of
@@ -45,9 +46,9 @@ UPPER=upper$$
 SCRIPT=script$$
 RESULT=result$$
 rm -f $UPPER $SCRIPT $RESULT
 SCRIPT=script$$
 RESULT=result$$
 rm -f $UPPER $SCRIPT $RESULT
-trap "rm -f $COL.* $INPUT $UPPER $SCRIPT $RESULT" 0 1 2 5 15
+trap "rm -f $COL.* $INPUT $UPPER $SCRIPT $RESULT" 0 1 2 3 15
 fgrep -v \# $1 | \
 fgrep -v \# $1 | \
-sed    -e 's/[ ]\+/    /g' >$INPUT
+sed    -e 's/[ ][      ]*/     /g' >$INPUT
 
 for F in 1 2 3 4
 do
 
 for F in 1 2 3 4
 do
@@ -63,7 +64,7 @@ paste $COL.* | \
 sed    -e 's/^/s\/\\</' \
        -e 's/$/\//' >$UPPER
 
 sed    -e 's/^/s\/\\</' \
        -e 's/$/\//' >$UPPER
 
-# Do the TH lines
+echo "# Do the TH lines" >>$RESULT
 sed    -e 's/\//\/TH /' \
        -e 's/  / /' \
        -e 's/  / ""\/TH /' \
 sed    -e 's/\//\/TH /' \
        -e 's/  / /' \
        -e 's/  / ""\/TH /' \
@@ -71,7 +72,7 @@ sed   -e 's/\//\/TH /' \
        -e 's/\/$/ ""\//' \
        $UPPER >>$RESULT
 
        -e 's/\/$/ ""\//' \
        $UPPER >>$RESULT
 
-# Do the embedded references
+echo "# Do the embedded references" >>$RESULT
 sed    -e 's/</<fB/' \
        -e 's/  /\\\\fR(/' \
        -e 's/  /)\/fB/' \
 sed    -e 's/</<fB/' \
        -e 's/  /\\\\fR(/' \
        -e 's/  /)\/fB/' \
@@ -79,5 +80,11 @@ sed  -e 's/</<fB/' \
        -e 's/\/$/)\//' \
        $UPPER >>$RESULT
 
        -e 's/\/$/)\//' \
        $UPPER >>$RESULT
 
+echo "# Do the \fBxxx\fR references in the .NAME section" >>$RESULT
+sed    -e 's/\\</^\\\\fB/' \
+       -e 's/  [^      ]*      /\\\\f[RP] -\/\\\\fB/' \
+       -e 's/  .*$/\\\\fR -\//' \
+       $UPPER >>$RESULT
+
 # Finally, send the result to standard output
 cat $RESULT
 # Finally, send the result to standard output
 cat $RESULT