summaryrefslogtreecommitdiff
path: root/progs/capconvert
diff options
context:
space:
mode:
Diffstat (limited to 'progs/capconvert')
-rwxr-xr-xprogs/capconvert44
1 files changed, 22 insertions, 22 deletions
diff --git a/progs/capconvert b/progs/capconvert
index 4b5b321a58ce..e2480450e82a 100755
--- a/progs/capconvert
+++ b/progs/capconvert
@@ -1,6 +1,6 @@
#!/bin/sh
##############################################################################
-# Copyright 2019-2021,2022 Thomas E. Dickey #
+# Copyright 2019-2022,2025 Thomas E. Dickey #
# Copyright 1998-2011,2017 Free Software Foundation, Inc. #
# #
# Permission is hereby granted, free of charge, to any person obtaining a #
@@ -27,7 +27,7 @@
# use or other dealings in this Software without prior written #
# authorization. #
##############################################################################
-# $Id: capconvert,v 1.12 2022/07/16 21:00:27 tom Exp $
+# $Id: capconvert,v 1.13 2025/06/14 15:16:35 tom Exp $
#
# capconvert -- automated conversion from termcap to terminfo
#
@@ -42,12 +42,12 @@ echo ""
# case they're on a workstation and probably don't.
# Check to make sure TERMINFO is not already defined
-if test -n "$TERMINFO"
+if [ -n "$TERMINFO" ]
then
echo "TERMINFO is already defined in your environment. This means"
echo "you already have a local terminfo tree, so you do not need any"
echo "conversion."
- if test ! -d "$TERMINFO" ; then
+ if [ ! -d "$TERMINFO" ] ; then
echo "Caution: TERMINFO does not point to a directory!"
fi
exit;
@@ -62,17 +62,17 @@ for p in $TERMINFO \
/usr/local/lib/terminfo \
/usr/local/share/terminfo
do
- if test -d "$p" ; then
+ if [ -d "$p" ] ; then
terminfo=yes
break
fi
done
-if test $terminfo = yes
+if [ $terminfo = yes ]
then
echo "Your system already has a system-wide terminfo tree."
echo ""
- if test -z "$TERMCAP"
+ if [ -z "$TERMCAP" ]
then
echo "You have no TERMCAP variable set, so we are done."
# Assumes the terminfo master covers all canned terminal types
@@ -97,7 +97,7 @@ echo "";
# Check if test -x works (it is not portable, but useful)
OPT="-x"
-TMP=test$$; touch $TMP && chmod 755 $TMP
+TMP="test$$"; touch "$TMP" && chmod 755 "$TMP"
if test $OPT $TMP ; then
chmod 644 $TMP
test $OPT $TMP && OPT="-f"
@@ -119,7 +119,7 @@ do
done
IFS="$save_ifs"
-if test -n "$TIC"
+if [ -n "$TIC" ]
then
echo "I see tic at $TIC."
case $TIC in # (vi
@@ -140,7 +140,7 @@ echo "";
#
# Make the user a terminfo directory
-if test -d "$HOME"/.terminfo
+if [ -d "$HOME"/.terminfo ]
then
echo "It appears you already have a private terminfo directory"
echo "at $HOME/.terminfo; this seems odd, because TERMINFO"
@@ -158,7 +158,7 @@ fi
echo "";
# Find a terminfo source to work from
-if test -f ../misc/terminfo.src
+if [ -f ../misc/terminfo.src ]
then
echo "I see the terminfo master source is handy; I will use that."
master=../misc/terminfo.src
@@ -189,7 +189,7 @@ else
do
echo "Please tell me which one to use:"
read master;
- if test -f "$master"
+ if [ -f "$master" ]
then
break
else
@@ -209,11 +209,11 @@ echo "OK, now I will make your private terminfo tree. This may take a bit..."
trap 'rm -f tsplit$$.*; exit 1' 1 2 3 15
trap 'rm -f tsplit$$.*' 0
sed -n "$master" \
- -e '1,/SPLIT HERE/w 'tsplit$$.01 \
- -e '/SPLIT HERE/,$w 'tsplit$$.02 \
+ -e '1,/SPLIT HERE/w '"tsplit$$.01" \
+ -e '/SPLIT HERE/,$w '"tsplit$$.02" \
2>/dev/null
-for x in tsplit$$.*; do eval $TIC "$x"; done
-rm tsplit$$.*
+for x in ./tsplit$$.*; do eval "$TIC" "$x"; done
+rm ./tsplit$$.*
trap EXIT INT QUIT TERM HUP
#
echo "You now have a private tree under $HOME/.terminfo;"
@@ -221,7 +221,7 @@ echo "the ncurses library will automatically read from it,"
echo "and ncurses tic will automatically compile entries to it."
# We're done unless user has a .termcap file or equivalent named by TERMCAP
-if test -z "$TERMCAP"
+if [ -z "$TERMCAP" ]
then
echo "You have no TERMCAP set, so we are done."
fi
@@ -232,23 +232,23 @@ fi
# we don't actually know what TERM will be nor even if it always has
# the same value for this user) we do the following three steps...
-if test -f "$HOME"/.termcap
+if [ -f "$HOME"/.termcap ]
then
echo "I see you have a \$HOME/.termcap file. I will compile that."
- eval $TIC "$HOME"/.termcap
+ eval "$TIC" "$HOME"/.termcap
echo "Done."
echo "Note that editing $HOME/.termcap will no longer change the data curses sees."
-elif test -f "$TERMCAP"
+elif [ -f "$TERMCAP" ]
then
echo "Your TERMCAP names the file $TERMCAP. I will compile that."
- eval $TIC "$TERMCAP"
+ eval "$TIC" "$TERMCAP"
echo "Done."
echo "Note that editing $TERMCAP will no longer change the data curses sees."
else
echo "Your TERMCAP value appears to be an entry in termcap format."
echo "I will compile it."
echo "$TERMCAP" >myterm$$
- eval $TIC myterm$$
+ eval "$TIC" myterm$$
rm myterm$$
echo "Done."
echo "Note that editing TERMCAP will no longer change the data curses sees."