summaryrefslogtreecommitdiff
path: root/ncurses/tinfo/MKkeys_list.sh
diff options
context:
space:
mode:
Diffstat (limited to 'ncurses/tinfo/MKkeys_list.sh')
-rwxr-xr-xncurses/tinfo/MKkeys_list.sh26
1 files changed, 13 insertions, 13 deletions
diff --git a/ncurses/tinfo/MKkeys_list.sh b/ncurses/tinfo/MKkeys_list.sh
index 05ac8cf62578..68eeb62f2564 100755
--- a/ncurses/tinfo/MKkeys_list.sh
+++ b/ncurses/tinfo/MKkeys_list.sh
@@ -1,7 +1,7 @@
#! /bin/sh
-# $Id: MKkeys_list.sh,v 1.9 2024/01/19 12:26:30 tom Exp $
+# $Id: MKkeys_list.sh,v 1.10 2025/06/14 16:03:56 tom Exp $
##############################################################################
-# Copyright 2019-2022,2024 Thomas E. Dickey #
+# Copyright 2019-2024,2025 Thomas E. Dickey #
# Copyright 2001-2003,2017 Free Software Foundation, Inc. #
# #
# Permission is hereby granted, free of charge, to any person obtaining a #
@@ -35,27 +35,27 @@
#
# Extract function-key names from the Caps file
#
-: ${AWK-awk}
-: ${USE_SIGWINCH-0}
-if test $# != 0
-then
- DATA="$*"
-else
- DATA=../../include/Caps
-fi
+: "${AWK-awk}"
+: "${USE_SIGWINCH-0}"
data=data$$
+tabs='s/[ ][ ]*/ /g'
trap 'rm -f $data; exit 1' 1 2 3 15
trap 'rm -f $data' 0
-cat $DATA | sed -e 's/[ ][ ]*/ /g' >$data
+if [ $# != 0 ]
+then
+ sed -e "$tabs" "$@" >$data
+else
+ sed -e "$tabs" ../../include/Caps >$data
+fi
cat <<EOF
-# These definitions were generated by $0 $DATA
+# These definitions were generated by $0 $*
KEY_BREAK
KEY_SRESET
KEY_RESET
EOF
-test "$USE_SIGWINCH" = 1 && echo KEY_RESIZE
+[ "$USE_SIGWINCH" = 1 ] && echo KEY_RESIZE
${AWK-awk} <$data '
/^#/ {next;}