about summary refs log tree commit diff stats
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/cfg_defs.sh17
-rwxr-xr-xscripts/fixtext.sh3
-rwxr-xr-xscripts/indent.sh138
-rwxr-xr-xscripts/install-cfg.sh52
-rwxr-xr-xscripts/install-lss.sh18
-rwxr-xr-xscripts/man2hlp.sh12
6 files changed, 123 insertions, 117 deletions
diff --git a/scripts/cfg_defs.sh b/scripts/cfg_defs.sh
index 5f37e962..560dfc41 100755
--- a/scripts/cfg_defs.sh
+++ b/scripts/cfg_defs.sh
@@ -1,4 +1,5 @@
 #!/bin/sh
+# $LynxId: cfg_defs.sh,v 1.2 2021/01/07 00:38:05 tom Exp $
 # Translate the lynx_cfg.h and config.cache data into a table, useful for
 # display at runtime.
 
@@ -6,9 +7,10 @@ TOP="${1-.}"
 OUT=cfg_defs.h
 
 # just in case we want to run this outside the makefile
-: ${SHELL:=/bin/sh}
+: "${SHELL:=/bin/sh}"
 
-cat >$OUT <<EOF
+{
+cat <<EOF
 #ifndef CFG_DEFS_H
 #define CFG_DEFS_H 1
 
@@ -23,9 +25,9 @@ sed \
 	-e 's/^.[^=]*_cv_//' \
 	-e 's/=\${.*=/=/'  \
 	-e 's/}$//'          \
-	config.cache | $SHELL $TOP/scripts/cfg_edit.sh >>$OUT
+	config.cache | $SHELL "$TOP/scripts/cfg_edit.sh"
 
-cat >>$OUT <<EOF
+cat <<EOF
 };
 
 static const struct {
@@ -33,16 +35,17 @@ static const struct {
 	const char *value;
 } config_defines[] = {
 EOF
-fgrep	'#define' lynx_cfg.h |
+${FGREP-fgrep}	'#define' lynx_cfg.h |
 sed	-e 's@	@ @g' \
 	-e 's@  @ @g' \
 	-e 's@^[ 	]*#define[ 	]*@@' \
 	-e 's@[ ]*/\*.*\*/@@' \
 	-e 's@[ 	][ 	]*@=@' \
-    | $SHELL $TOP/scripts/cfg_edit.sh >>$OUT
+    | $SHELL "$TOP/scripts/cfg_edit.sh"
 
-cat >>$OUT <<EOF
+cat <<EOF
 };
 
 #endif /* CFG_DEFS_H */
 EOF
+} >$OUT
diff --git a/scripts/fixtext.sh b/scripts/fixtext.sh
index 1f5c1abd..a6f53b6b 100755
--- a/scripts/fixtext.sh
+++ b/scripts/fixtext.sh
@@ -1,4 +1,5 @@
 #!/bin/sh
+# $LynxId: fixtext.sh,v 1.2 2021/01/07 00:21:03 tom Exp $
 
 # xgettext only processes literal strings.  Someone with a poor sense of humor
 # decided to ignore strings in preprocessor lines.  So we construct a fake
@@ -7,4 +8,4 @@
 sed	-e 's/")/");/' \
 	-e 's/^#define[ 	]*\([^ 	]*\)[ 	]*gettext/char *\1 = gettext/' \
 	-e 's,^#define[ 	]*\([^ 	]*\)[ 	]*\\,/* #define \1 */char *\1 = \\,' \
-	$*
+	"$@"
diff --git a/scripts/indent.sh b/scripts/indent.sh
index 506be6a1..89330847 100755
--- a/scripts/indent.sh
+++ b/scripts/indent.sh
@@ -1,5 +1,5 @@
 #!/bin/sh
-# $LynxId: indent.sh,v 1.5 2018/07/08 15:22:44 tom Exp $
+# $LynxId: indent.sh,v 1.6 2021/01/07 00:23:01 tom Exp $
 # Indent LYNX files (for reference).  See "lnx-indent" from
 #	https://invisible-island.net/cindent/
 NOOP=no
@@ -18,85 +18,85 @@ OPTS='
 --space-after-cast
 --space-special-semicolon
 --swallow-optional-blank-lines
--T AddressDefList 
+-T AddressDefList
 -T BOOL
 -T BOOLEAN
--T CSOfield_info 
+-T CSOfield_info
 -T DIR
--T DocAddress 
--T DocInfo 
+-T DocAddress
+-T DocInfo
 -T DocObj
--T EntryInfo 
--T EditFieldData 
+-T EntryInfo
+-T EditFieldData
 -T FILE
--T GCC_NORETURN 
--T GCC_UNUSED 
--T GLOBALREF 
--T GroupDef 
--T GroupDefList 
--T HTAAFailReasonType 
--T HTAAProt 
--T HTAARealm 
--T HTAAServer 
--T HTAssoc 
--T HTAssocList 
--T HTAtom 
--T HTBTElement 
--T HTBTree 
--T HTChildAnchor 
--T HTChunk 
--T HTConverter 
--T HTFormat 
--T HTLine 
--T HTLinkType 
--T HTList 
--T HTParentAnchor 
--T HTParentAnchor0 
--T HTPresentation 
+-T GCC_NORETURN
+-T GCC_UNUSED
+-T GLOBALREF
+-T GroupDef
+-T GroupDefList
+-T HTAAFailReasonType
+-T HTAAProt
+-T HTAARealm
+-T HTAAServer
+-T HTAssoc
+-T HTAssocList
+-T HTAtom
+-T HTBTElement
+-T HTBTree
+-T HTChildAnchor
+-T HTChunk
+-T HTConverter
+-T HTFormat
+-T HTLine
+-T HTLinkType
+-T HTList
+-T HTParentAnchor
+-T HTParentAnchor0
+-T HTPresentation
 -T HTStream
--T HTStyle 
--T HTStyleChange 
--T HTStyleSheet 
--T HText 
--T HyperDoc 
--T InitResponseAPDU 
--T Item 
--T ItemList 
+-T HTStyle
+-T HTStyleChange
+-T HTStyleSheet
+-T HText
+-T HyperDoc
+-T InitResponseAPDU
+-T Item
+-T ItemList
 -T LYNX_ADDRINFO
 -T LYNX_HOSTENT
--T LYUCcharset 
--T LexItem 
--T ProgramPaths 
--T STable_cellinfo 
--T STable_info 
--T STable_rowinfo 
--T STable_states 
--T SearchAPDU 
--T SearchResponseAPDU 
--T TextAnchor 
--T UCode_t 
--T UserDefList 
--T WAISDocumentCodes 
--T WAISDocumentHeader 
--T WAISDocumentHeadlines 
--T WAISDocumentLongHeader 
--T WAISDocumentShortHeader 
--T WAISDocumentText 
--T WAISInitResponse 
--T WAISSearch 
+-T LYUCcharset
+-T LexItem
+-T ProgramPaths
+-T STable_cellinfo
+-T STable_info
+-T STable_rowinfo
+-T STable_states
+-T SearchAPDU
+-T SearchResponseAPDU
+-T TextAnchor
+-T UCode_t
+-T UserDefList
+-T WAISDocumentCodes
+-T WAISDocumentHeader
+-T WAISDocumentHeadlines
+-T WAISDocumentLongHeader
+-T WAISDocumentShortHeader
+-T WAISDocumentText
+-T WAISInitResponse
+-T WAISSearch
 -T _cdecl
--T any 
--T bit_map 
--T boolean 
--T bstring 
+-T any
+-T bit_map
+-T boolean
+-T bstring
 -T data_tag
--T eServerType 
--T lynx_list_item_type 
+-T eServerType
+-T lynx_list_item_type
 -T pdu_type
--T query_term 
+-T query_term
 -nbacc
 '
-for name in $*
+for name in "$@"
 do
 	case $name in
 	-n)	NOOP=yes
@@ -128,9 +128,9 @@ do
 		mv "$test" "$name"
 		rm -f "${name}~"
 		if test $NOOP = yes ; then
-			if ! ( cmp -s "$name" $save )
+			if ! ( cmp -s "$name" "$save" )
 			then
-				diff -u $save "$name"
+				diff -u "$save" "$name"
 			fi
 			mv "$save" "$name"
 			rm -f "${name}~"
diff --git a/scripts/install-cfg.sh b/scripts/install-cfg.sh
index a4228cd7..6faa21a5 100755
--- a/scripts/install-cfg.sh
+++ b/scripts/install-cfg.sh
@@ -1,5 +1,5 @@
 #!/bin/sh
-# $LynxId: install-cfg.sh,v 1.4 2018/03/21 16:20:42 tom Exp $
+# $LynxId: install-cfg.sh,v 1.5 2021/01/07 00:31:20 tom Exp $
 # install lynx.cfg, ensuring the old config-file is saved to a unique file,
 # and prepending customizations to the newly-installed file.
 #
@@ -21,33 +21,35 @@ if test -f "$DST" ; then
 	NEW=lynx-cfg.new
 	TST=lynx-cfg.tst
 	TMP=lynx-cfg.tmp
-	trap "rm -f $OLD $NEW $TST $TMP; exit 9" 1 2 5 15
+	trap 'rm -f $OLD $NEW $TST $TMP; exit 9' INT QUIT TERM HUP
 	rm -f $OLD $NEW $TST $TMP
 
 	# avoid propagating obsolete URLs into new installs
-	echo lynx.isc.org >$TMP
-	echo lynx.browser.org >$TMP
-	echo www.trill-home.com >>$TMP
-	echo www.cc.ukans.edu >>$TMP
-	echo www.ukans.edu >>$TMP
-	echo www.slcc.edu >>$TMP
-	echo sol.slcc.edu >>$TMP
+	{
+		echo lynx.isc.org;
+		echo lynx.browser.org;
+		echo www.trill-home.com;
+		echo www.cc.ukans.edu;
+		echo www.ukans.edu;
+		echo www.slcc.edu;
+		echo sol.slcc.edu;
+	}>$TMP
 
 	# Make a list of the settings which are in the original lynx.cfg
 	# Do not keep the user's HELPFILE setting since we modify that in
 	# a different makefile rule.
-	egrep '^[ 	]*[A-Za-z]' $SRC |sed -e 's/^[ 	]*HELPFILE:.*/HELPFILE:/' >>$TMP
-	egrep '^[ 	]*[A-Za-z]' $SRC |fgrep -v -f $TMP >$OLD
-	egrep '^[ 	]*[A-Za-z]' $DST |fgrep -v -f $TMP >$TST
+	${EGREP-egrep} '^[ 	]*[A-Za-z]' "$SRC" |sed -e 's/^[ 	]*HELPFILE:.*/HELPFILE:/' >>$TMP
+	${EGREP-egrep} '^[ 	]*[A-Za-z]' "$SRC" |${FGREP-fgrep} -v -f $TMP >$OLD
+	${EGREP-egrep} '^[ 	]*[A-Za-z]' "$DST" |${FGREP-fgrep} -v -f $TMP >$TST
 
 	if test -s $TST ; then
 		cat >$TMP <<EOF
 ## The following lines were saved from your previous configuration.
 
 EOF
-		cat $TST >>$TMP
-		cat $SRC >$NEW
-		cat $TMP >>$NEW
+		cat "$TST" >>$TMP
+		cat "$SRC" >$NEW
+		cat "$TMP" >>$NEW
 
 		# See if we have saved this information before (ignoring the
 		# HELPFILE line).
@@ -56,32 +58,32 @@ EOF
 			echo "... installed $DST would not be changed"
 		else
 			NUM=1
-			while test -f ${DST}-${NUM}
+			while test -f "${DST}-${NUM}"
 			do
-				if cmp -s $NEW ${DST}-${NUM}
+				if cmp -s "$NEW" "${DST}-${NUM}"
 				then
 					break
 				fi
-				NUM=`expr $NUM + 1`
+				NUM=`expr "$NUM" + 1`
 			done
-			if test ! -f ${DST}-${NUM}
+			if test ! -f "${DST}-${NUM}"
 			then
 				echo "... saving old config as ${DST}-${NUM}"
-				mv $DST ${DST}-${NUM} || exit 1
+				mv "$DST" "${DST}-${NUM}" || exit 1
 			fi
 			echo "** installing $NEW as $DST"
-			eval $PRG $NEW $DST || exit 1
+			eval "$PRG" "$NEW" "$DST" || exit 1
 		fi
 	else
 		echo "... no customizations found"
 		echo "** installing $SRC as $DST"
-		eval $PRG $SRC $DST || exit 1
+		eval "$PRG" "$SRC" "$DST" || exit 1
 	fi
-	rm -f $SKIP $OLD $NEW $TST $TMP
-elif cmp -s $SRC $DST
+	rm -f "$SKIP" "$OLD" "$NEW" "$TST" "$TMP"
+elif cmp -s "$SRC" "$DST"
 then
 	echo "... installed $DST would not be changed"
 else
 	echo "** installing $SRC as $DST"
-	eval $PRG $SRC $DST || exit 1
+	eval "$PRG" "$SRC" "$DST" || exit 1
 fi
diff --git a/scripts/install-lss.sh b/scripts/install-lss.sh
index 6573a35e..eb9694af 100755
--- a/scripts/install-lss.sh
+++ b/scripts/install-lss.sh
@@ -1,5 +1,5 @@
 #!/bin/sh
-# $LynxId: install-lss.sh,v 1.1 2007/05/13 22:15:29 tom Exp $
+# $LynxId: install-lss.sh,v 1.2 2021/01/07 00:32:39 tom Exp $
 # install lynx.lss, ensuring the old config-file is saved to a backup file.
 #
 # $1 = install program
@@ -11,28 +11,28 @@ DST=$3
 
 if test -f "$DST" ; then
 	# See if we have saved this information before
-	if cmp -s $SRC $DST
+	if cmp -s "$SRC" "$DST"
 	then
 		echo "... installed $DST would not be changed"
 	else
 		NUM=1
-		while test -f ${DST}-${NUM}
+		while test -f "${DST}-${NUM}"
 		do
-			if cmp -s $SRC ${DST}-${NUM}
+			if cmp -s "$SRC" "${DST}-${NUM}"
 			then
 				break
 			fi
-			NUM=`expr $NUM + 1`
+			NUM=`expr "$NUM" + 1`
 		done
-		if test ! -f ${DST}-${NUM}
+		if test ! -f "${DST}-${NUM}"
 		then
 			echo "... saving old config as ${DST}-${NUM}"
-			mv $DST ${DST}-${NUM} || exit 1
+			mv "$DST" "${DST}-${NUM}" || exit 1
 		fi
 		echo "** installing $SRC as $DST"
-		eval $PRG $SRC $DST || exit 1
+		eval "$PRG" "$SRC" "$DST" || exit 1
 	fi
 else
 	echo "** installing $SRC as $DST"
-	eval $PRG $SRC $DST || exit 1
+	eval "$PRG" "$SRC" "$DST" || exit 1
 fi
diff --git a/scripts/man2hlp.sh b/scripts/man2hlp.sh
index fed9b428..cc1653cb 100755
--- a/scripts/man2hlp.sh
+++ b/scripts/man2hlp.sh
@@ -1,5 +1,5 @@
 #!/bin/sh
-# $LynxId: man2hlp.sh,v 1.3 2008/09/10 13:25:45 tom Exp $
+# $LynxId: man2hlp.sh,v 1.4 2021/01/07 00:34:48 tom Exp $
 # This script uses rman (Rosetta Man), which complements TkMan, to strip
 # nroff headers from a manpage file, and format the result into a VMS help
 # file.
@@ -9,13 +9,13 @@ LC_ALL=C;	export LC_ALL
 LC_CTYPE=C;	export LC_CTYPE
 LANGUAGE=C;	export LANGUAGE
 
-for name in $*
+for name in "$@"
 do
-	NAME=`echo $name |sed -e 's/\.man$/.1/'`
-	(echo 1 `echo $NAME | sed -e 's/^.*\///' -e 's/\..*$//' | tr '[a-z]' '[A-Z]'` ; \
-	(echo '.hy 0'; cat $name) |\
+	NAME=`echo "$name" |sed -e 's/\.man$/.1/'`
+	(echo 1 "`echo \"$NAME\" | sed -e 's/^.*\///' -e 's/\..*$//' | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`" ; \
+	(echo '.hy 0'; cat "$name") |\
 	nroff -Tascii -man |\
-	rman -n$NAME |\
+	rman -n"$NAME" |\
 	sed	-e 's/^[1-9].*$//' \
 		-e 's/^\([A-Z]\)/2 \1/' |\
 	uniq)