X-Git-Url: https://ncurses.scripts.mit.edu/?a=blobdiff_plain;f=man%2Fmake_sed.sh;h=2a290f0b1d9f7e0e5752e1e2c7d737b4e86b16c7;hb=7723dd6799ab10b32047ec73b14df9f107bafe99;hp=c6c37c25b0d55d96ac6b129dcf193c5b8a96f3bd;hpb=661078ddbde3ce0f3b06e95642fbb9b5fef7dca1;p=ncurses.git diff --git a/man/make_sed.sh b/man/make_sed.sh index c6c37c25..2a290f0b 100755 --- a/man/make_sed.sh +++ b/man/make_sed.sh @@ -1,7 +1,8 @@ #!/bin/sh -# $Id: make_sed.sh,v 1.5 1998/02/11 12:13:48 tom Exp $ +# $Id: make_sed.sh,v 1.16 2022/10/01 13:14:07 tom Exp $ ############################################################################## -# Copyright (c) 1998 Free Software Foundation, Inc. # +# 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 # # copy of this software and associated documentation files (the "Software"), # @@ -28,7 +29,7 @@ # authorization. # ############################################################################## # -# Author: Thomas E. Dickey 1997 +# 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 @@ -45,9 +46,10 @@ UPPER=upper$$ SCRIPT=script$$ RESULT=result$$ rm -f $UPPER $SCRIPT $RESULT -trap "rm -f $COL.* $INPUT $UPPER $SCRIPT $RESULT" 0 1 2 5 15 -fgrep -v \# $1 | \ -sed -e 's/[ ]\+/ /g' >$INPUT +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 do @@ -57,27 +59,35 @@ done for F in 2 4 do tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ <$COL.$F >$UPPER - mv $UPPER $COL.$F + mv $UPPER $COL.$F done paste $COL.* | \ sed -e 's/^/s\/\\$UPPER -# Do the TH lines +{ +echo "# Do the TH lines" sed -e 's/\//\/TH /' \ -e 's/ / /' \ -e 's/ / ""\/TH /' \ -e 's/ / /' \ -e 's/\/$/ ""\//' \ - $UPPER >>$RESULT + $UPPER -# Do the embedded references +echo "# Do the embedded references" sed -e 's/>$RESULT + $UPPER + +echo '# Do the \\fBxxx\\fP references in the .NAME section' +sed -e 's/\\>$RESULT # Finally, send the result to standard output cat $RESULT