X-Git-Url: https://ncurses.scripts.mit.edu/?a=blobdiff_plain;f=man%2Fmake_sed.sh;h=2a290f0b1d9f7e0e5752e1e2c7d737b4e86b16c7;hb=88595a127ec2e56af0875eb04e0f2396d6d121c5;hp=2a60cbdde4350e9bb76a85afbb89dd3910c58c48;hpb=74433bcf4f6fe40862a28f3c00edaedcd5054b01;p=ncurses.git diff --git a/man/make_sed.sh b/man/make_sed.sh index 2a60cbdd..2a290f0b 100755 --- a/man/make_sed.sh +++ b/man/make_sed.sh @@ -1,7 +1,7 @@ #!/bin/sh -# $Id: make_sed.sh,v 1.13 2021/12/25 17:39:16 tom Exp $ +# $Id: make_sed.sh,v 1.16 2022/10/01 13:14:07 tom Exp $ ############################################################################## -# Copyright 2020,2021 Thomas E. Dickey # +# Copyright 2020-2021,2022 Thomas E. Dickey # # Copyright 1998-2005,2017 Free Software Foundation, Inc. # # # # Permission is hereby granted, free of charge, to any person obtaining a # @@ -29,7 +29,7 @@ # authorization. # ############################################################################## # -# Author: Thomas E. Dickey 1997-2005 +# Author: Thomas E. Dickey 1997 # # Construct a sed-script to perform renaming within man-pages. Originally # written in much simpler form, this one accounts for the common cases of @@ -46,8 +46,9 @@ UPPER=upper$$ SCRIPT=script$$ RESULT=result$$ rm -f $UPPER $SCRIPT $RESULT -trap "rm -f $COL.* $INPUT $UPPER $SCRIPT $RESULT" 0 1 2 3 15 -fgrep -v \# $1 | \ +trap "rm -f $COL.* $INPUT $UPPER $SCRIPT $RESULT; exit 1" 1 2 3 15 +trap "rm -f $COL.* $INPUT $UPPER $SCRIPT $RESULT" 0 +${FGREP-grep -F} -v \# "$1" | \ sed -e 's/[ ][ ]*/ /g' >$INPUT for F in 1 2 3 4 @@ -64,27 +65,29 @@ paste $COL.* | \ sed -e 's/^/s\/\\$UPPER -echo "# Do the TH lines" >>$RESULT +{ +echo "# Do the TH lines" sed -e 's/\//\/TH /' \ -e 's/ / /' \ -e 's/ / ""\/TH /' \ -e 's/ / /' \ -e 's/\/$/ ""\//' \ - $UPPER >>$RESULT + $UPPER -echo "# Do the embedded references" >>$RESULT +echo "# Do the embedded references" sed -e 's/>$RESULT + $UPPER -echo "# Do the \fBxxx\fP references in the .NAME section" >>$RESULT +echo '# Do the \\fBxxx\\fP references in the .NAME section' sed -e 's/\\>$RESULT + $UPPER +} >>$RESULT # Finally, send the result to standard output cat $RESULT