#!/bin/sh
-# $Id: make_sed.sh,v 1.15 2022/07/16 20:20:00 tom Exp $
+# $Id: make_sed.sh,v 1.17 2023/06/25 18:13:17 tom Exp $
##############################################################################
-# Copyright 2020-2021,2022 Thomas E. Dickey #
+# Copyright 2020-2022,2023 Thomas E. Dickey #
# Copyright 1998-2005,2017 Free Software Foundation, Inc. #
# #
# Permission is hereby granted, free of charge, to any person obtaining a #
# 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
rm -f $UPPER $SCRIPT $RESULT
trap "rm -f $COL.* $INPUT $UPPER $SCRIPT $RESULT; exit 1" 1 2 3 15
trap "rm -f $COL.* $INPUT $UPPER $SCRIPT $RESULT" 0
-fgrep -v \# "$1" | \
+${FGREP-grep -F} -v \# "$1" | \
sed -e 's/[ ][ ]*/ /g' >$INPUT
for F in 1 2 3 4
echo "# Do the TH lines"
sed -e 's/\//\/TH /' \
-e 's/ / /' \
- -e 's/ / ""\/TH /' \
+ -e 's/ / \/TH /' \
-e 's/ / /' \
- -e 's/\/$/ ""\//' \
+ -e 's/\/$/ \//' \
$UPPER
echo "# Do the embedded references"