aboutsummaryrefslogtreecommitdiff
path: root/contrib/bsddialog/examples_utility
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/bsddialog/examples_utility')
-rw-r--r--contrib/bsddialog/examples_utility/calendar.sh34
-rwxr-xr-xcontrib/bsddialog/examples_utility/checklist.sh38
-rwxr-xr-xcontrib/bsddialog/examples_utility/datebox.sh34
-rwxr-xr-xcontrib/bsddialog/examples_utility/form.sh38
-rwxr-xr-xcontrib/bsddialog/examples_utility/gauge.sh28
-rwxr-xr-xcontrib/bsddialog/examples_utility/infobox.sh12
-rwxr-xr-xcontrib/bsddialog/examples_utility/inputbox.sh33
-rwxr-xr-xcontrib/bsddialog/examples_utility/menu.sh38
-rwxr-xr-xcontrib/bsddialog/examples_utility/mixedform.sh37
-rwxr-xr-xcontrib/bsddialog/examples_utility/mixedgauge.sh33
-rwxr-xr-xcontrib/bsddialog/examples_utility/msgbox.sh28
-rwxr-xr-xcontrib/bsddialog/examples_utility/passwordbox.sh34
-rwxr-xr-xcontrib/bsddialog/examples_utility/passwordform.sh39
-rwxr-xr-xcontrib/bsddialog/examples_utility/pause.sh36
-rwxr-xr-xcontrib/bsddialog/examples_utility/radiolist.sh38
-rw-r--r--contrib/bsddialog/examples_utility/rangebox.sh33
-rwxr-xr-xcontrib/bsddialog/examples_utility/timebox.sh33
-rwxr-xr-xcontrib/bsddialog/examples_utility/yesno.sh32
18 files changed, 598 insertions, 0 deletions
diff --git a/contrib/bsddialog/examples_utility/calendar.sh b/contrib/bsddialog/examples_utility/calendar.sh
new file mode 100644
index 000000000000..a7ce4f1bb1d5
--- /dev/null
+++ b/contrib/bsddialog/examples_utility/calendar.sh
@@ -0,0 +1,34 @@
+#!/bin/sh
+#-
+# SPDX-License-Identifier: CC0-1.0
+#
+# Written in 2022 by Alfonso Sabato Siciliano.
+#
+# To the extent possible under law, the author has dedicated all copyright
+# and related and neighboring rights to this software to the public domain
+# worldwide. This software is distributed without any warranty, see:
+# <http://creativecommons.org/publicdomain/zero/1.0/>.
+
+: ${BSDDIALOG_ERROR=255}
+: ${BSDDIALOG_OK=0}
+: ${BSDDIALOG_CANCEL=1}
+: ${BSDDIALOG_ESC=5}
+
+DATE=$(./bsddialog --title " calendar " --date-format "%x" \
+ --calendar "Hello World!" 20 40 \
+3>&1 1>&2 2>&3 3>&-)
+
+case $? in
+ $BSDDIALOG_ERROR )
+ exit 1
+ ;;
+ $BSDDIALOG_ESC )
+ echo "[ESC]"
+ ;;
+ $BSDDIALOG_CANCEL )
+ echo "[Cancel]"
+ ;;
+ $BSDDIALOG_OK )
+ echo "[OK] $DATE"
+ ;;
+esac
diff --git a/contrib/bsddialog/examples_utility/checklist.sh b/contrib/bsddialog/examples_utility/checklist.sh
new file mode 100755
index 000000000000..7ff525cf765d
--- /dev/null
+++ b/contrib/bsddialog/examples_utility/checklist.sh
@@ -0,0 +1,38 @@
+#!/bin/sh
+#-
+# SPDX-License-Identifier: CC0-1.0
+#
+# Written in 2021 by Alfonso Sabato Siciliano.
+#
+# To the extent possible under law, the author has dedicated all copyright
+# and related and neighboring rights to this software to the public domain
+# worldwide. This software is distributed without any warranty, see:
+# <http://creativecommons.org/publicdomain/zero/1.0/>.
+
+: ${BSDDIALOG_ERROR=255}
+: ${BSDDIALOG_OK=0}
+: ${BSDDIALOG_CANCEL=1}
+: ${BSDDIALOG_ESC=5}
+
+ITEMS=$(./bsddialog --title " checklist " --checklist "Hello World!" 15 30 5 \
+ "1 Name" "DESC 1 xyz" on \
+ "2 Name" "DESC 2 xyz" off \
+ "3 Name" "DESC 3 xyz" on \
+ "4 Name" "DESC 4 xyz" off \
+ "5 Name" "DESC 5 xyz" on \
+3>&1 1>&2 2>&3 3>&-)
+
+case $? in
+ $BSDDIALOG_ERROR )
+ exit 1
+ ;;
+ $BSDDIALOG_ESC )
+ echo "[ESC]"
+ ;;
+ $BSDDIALOG_CANCEL )
+ echo "[Cancel]"
+ ;;
+ $BSDDIALOG_OK )
+ echo "[OK] $ITEMS"
+ ;;
+esac
diff --git a/contrib/bsddialog/examples_utility/datebox.sh b/contrib/bsddialog/examples_utility/datebox.sh
new file mode 100755
index 000000000000..bea4559dfbec
--- /dev/null
+++ b/contrib/bsddialog/examples_utility/datebox.sh
@@ -0,0 +1,34 @@
+#!/bin/sh
+#-
+# SPDX-License-Identifier: CC0-1.0
+#
+# Written in 2023 by Alfonso Sabato Siciliano.
+#
+# To the extent possible under law, the author has dedicated all copyright
+# and related and neighboring rights to this software to the public domain
+# worldwide. This software is distributed without any warranty, see:
+# <http://creativecommons.org/publicdomain/zero/1.0/>.
+
+: ${BSDDIALOG_ERROR=255}
+: ${BSDDIALOG_OK=0}
+: ${BSDDIALOG_CANCEL=1}
+: ${BSDDIALOG_ESC=5}
+
+DATE=$(./bsddialog --title " datebox " --date-format "%x" \
+ --datebox "Hello World!" 9 30 \
+3>&1 1>&2 2>&3 3>&-)
+
+case $? in
+ $BSDDIALOG_ERROR )
+ exit 1
+ ;;
+ $BSDDIALOG_ESC )
+ echo "[ESC]"
+ ;;
+ $BSDDIALOG_CANCEL )
+ echo "[Cancel]"
+ ;;
+ $BSDDIALOG_OK )
+ echo "[OK] $DATE"
+ ;;
+esac
diff --git a/contrib/bsddialog/examples_utility/form.sh b/contrib/bsddialog/examples_utility/form.sh
new file mode 100755
index 000000000000..ee25fa9cf352
--- /dev/null
+++ b/contrib/bsddialog/examples_utility/form.sh
@@ -0,0 +1,38 @@
+#!/bin/sh
+#-
+# SPDX-License-Identifier: CC0-1.0
+#
+# Written in 2021 by Alfonso Sabato Siciliano.
+#
+# To the extent possible under law, the author has dedicated all copyright
+# and related and neighboring rights to this software to the public domain
+# worldwide. This software is distributed without any warranty, see:
+# <http://creativecommons.org/publicdomain/zero/1.0/>.
+
+: ${BSDDIALOG_ERROR=255}
+: ${BSDDIALOG_OK=0}
+: ${BSDDIALOG_CANCEL=1}
+: ${BSDDIALOG_ESC=5}
+
+FORMS=$(./bsddialog --title " form " --form "Hello World!" 12 40 5 \
+ Label1: 0 0 Value1 0 8 18 25 \
+ Label2: 1 0 Value2 1 8 18 25 \
+ Label3: 2 0 Value3 2 8 18 25 \
+ Label4: 3 0 Value4 3 8 18 25 \
+ Label5: 4 0 Value5 4 8 18 25 \
+3>&1 1>&2 2>&3 3>&-)
+
+case $? in
+ $BSDDIALOG_ERROR )
+ exit 1
+ ;;
+ $BSDDIALOG_ESC )
+ echo "[ESC]"
+ ;;
+ $BSDDIALOG_CANCEL )
+ echo "[Cancel]"
+ ;;
+ $BSDDIALOG_OK )
+ echo "[OK] $FORMS"
+ ;;
+esac
diff --git a/contrib/bsddialog/examples_utility/gauge.sh b/contrib/bsddialog/examples_utility/gauge.sh
new file mode 100755
index 000000000000..a06a77034b75
--- /dev/null
+++ b/contrib/bsddialog/examples_utility/gauge.sh
@@ -0,0 +1,28 @@
+#!/bin/sh
+#-
+# SPDX-License-Identifier: CC0-1.0
+#
+# Written in 2021 by Alfonso Sabato Siciliano.
+#
+# To the extent possible under law, the author has dedicated all copyright
+# and related and neighboring rights to this software to the public domain
+# worldwide. This software is distributed without any warranty, see:
+# <http://creativecommons.org/publicdomain/zero/1.0/>.
+
+characters="A B C D E F G"
+total=`echo $characters | awk '{print split($0, a)}'`
+i=1
+for c in $characters
+do
+ sleep 1
+ echo XXX
+ echo "$(expr $(expr $i "*" 100) "/" $total)"
+ echo "[$i/$total] Char: $c"
+ echo XXX
+ if [ $i -eq $total ]
+ then
+ sleep 1
+ echo EOF
+ fi
+ i=`expr $i + 1`
+done | ./bsddialog --title " gauge " --gauge "[0/$total] Starting..." 10 70
diff --git a/contrib/bsddialog/examples_utility/infobox.sh b/contrib/bsddialog/examples_utility/infobox.sh
new file mode 100755
index 000000000000..b782e8cbf69e
--- /dev/null
+++ b/contrib/bsddialog/examples_utility/infobox.sh
@@ -0,0 +1,12 @@
+#!/bin/sh
+#-
+# SPDX-License-Identifier: CC0-1.0
+#
+# Written in 2021 by Alfonso Sabato Siciliano.
+#
+# To the extent possible under law, the author has dedicated all copyright
+# and related and neighboring rights to this software to the public domain
+# worldwide. This software is distributed without any warranty, see:
+# <http://creativecommons.org/publicdomain/zero/1.0/>.
+
+./bsddialog --normal-screen --title " infobox " --infobox "Hello World!" 6 20
diff --git a/contrib/bsddialog/examples_utility/inputbox.sh b/contrib/bsddialog/examples_utility/inputbox.sh
new file mode 100755
index 000000000000..756aec3c0241
--- /dev/null
+++ b/contrib/bsddialog/examples_utility/inputbox.sh
@@ -0,0 +1,33 @@
+#!/bin/sh
+#-
+# SPDX-License-Identifier: CC0-1.0
+#
+# Written in 2021 by Alfonso Sabato Siciliano.
+#
+# To the extent possible under law, the author has dedicated all copyright
+# and related and neighboring rights to this software to the public domain
+# worldwide. This software is distributed without any warranty, see:
+# <http://creativecommons.org/publicdomain/zero/1.0/>.
+
+: ${BSDDIALOG_ERROR=255}
+: ${BSDDIALOG_OK=0}
+: ${BSDDIALOG_CANCEL=1}
+: ${BSDDIALOG_ESC=5}
+
+FORM=$(./bsddialog --title " inputbox " --inputbox "Hello World!" 12 40 init \
+3>&1 1>&2 2>&3 3>&-)
+
+case $? in
+ $BSDDIALOG_ERROR )
+ exit 1
+ ;;
+ $BSDDIALOG_ESC )
+ echo "[ESC]"
+ ;;
+ $BSDDIALOG_CANCEL )
+ echo "[Cancel]"
+ ;;
+ $BSDDIALOG_OK )
+ echo "[OK] $FORM"
+ ;;
+esac
diff --git a/contrib/bsddialog/examples_utility/menu.sh b/contrib/bsddialog/examples_utility/menu.sh
new file mode 100755
index 000000000000..5b2f090037d8
--- /dev/null
+++ b/contrib/bsddialog/examples_utility/menu.sh
@@ -0,0 +1,38 @@
+#!/bin/sh
+#-
+# SPDX-License-Identifier: CC0-1.0
+#
+# Written in 2021 by Alfonso Sabato Siciliano.
+#
+# To the extent possible under law, the author has dedicated all copyright
+# and related and neighboring rights to this software to the public domain
+# worldwide. This software is distributed without any warranty, see:
+# <http://creativecommons.org/publicdomain/zero/1.0/>.
+
+: ${BSDDIALOG_ERROR=255}
+: ${BSDDIALOG_OK=0}
+: ${BSDDIALOG_CANCEL=1}
+: ${BSDDIALOG_ESC=5}
+
+ITEM=$(./bsddialog --title " menu " --menu "Hello World!" 15 30 5 \
+ "1 Name" "DESC 1 xyz" \
+ "2 Name" "DESC 2 xyz" \
+ "3 Name" "DESC 3 xyz" \
+ "4 Name" "DESC 4 xyz" \
+ "5 Name" "DESC 5 xyz" \
+3>&1 1>&2 2>&3 3>&-)
+
+case $? in
+ $BSDDIALOG_ERROR )
+ exit 1
+ ;;
+ $BSDDIALOG_ESC )
+ echo "[ESC]"
+ ;;
+ $BSDDIALOG_CANCEL )
+ echo "[Cancel]"
+ ;;
+ $BSDDIALOG_OK )
+ echo "[OK] $ITEM"
+ ;;
+esac
diff --git a/contrib/bsddialog/examples_utility/mixedform.sh b/contrib/bsddialog/examples_utility/mixedform.sh
new file mode 100755
index 000000000000..6b690e7e5b8c
--- /dev/null
+++ b/contrib/bsddialog/examples_utility/mixedform.sh
@@ -0,0 +1,37 @@
+#!/bin/sh
+#-
+# SPDX-License-Identifier: CC0-1.0
+#
+# Written in 2021 by Alfonso Sabato Siciliano.
+#
+# To the extent possible under law, the author has dedicated all copyright
+# and related and neighboring rights to this software to the public domain
+# worldwide. This software is distributed without any warranty, see:
+# <http://creativecommons.org/publicdomain/zero/1.0/>.
+
+: ${BSDDIALOG_ERROR=255}
+: ${BSDDIALOG_OK=0}
+: ${BSDDIALOG_CANCEL=1}
+: ${BSDDIALOG_ESC=5}
+
+FORMS=$(./bsddialog --insecure --title " mixedform " \
+ --mixedform "Hello World!" 12 40 3 \
+ Label: 0 0 Entry 0 10 18 25 0 \
+ Label: 1 0 Read-Only 1 10 18 25 2 \
+ Password: 2 0 "" 2 10 18 25 1 \
+3>&1 1>&2 2>&3 3>&-)
+
+case $? in
+ $BSDDIALOG_ERROR )
+ exit 1
+ ;;
+ $BSDDIALOG_ESC )
+ echo "[ESC]"
+ ;;
+ $BSDDIALOG_CANCEL )
+ echo "[Cancel]"
+ ;;
+ $BSDDIALOG_OK )
+ echo "[OK] $FORMS"
+ ;;
+esac
diff --git a/contrib/bsddialog/examples_utility/mixedgauge.sh b/contrib/bsddialog/examples_utility/mixedgauge.sh
new file mode 100755
index 000000000000..aa4ff2910cd9
--- /dev/null
+++ b/contrib/bsddialog/examples_utility/mixedgauge.sh
@@ -0,0 +1,33 @@
+#!/bin/sh
+#-
+# SPDX-License-Identifier: CC0-1.0
+#
+# Written in 2021 by Alfonso Sabato Siciliano.
+#
+# To the extent possible under law, the author has dedicated all copyright
+# and related and neighboring rights to this software to the public domain
+# worldwide. This software is distributed without any warranty, see:
+# <http://creativecommons.org/publicdomain/zero/1.0/>.
+
+perc=0
+mainperc=50
+while [ $perc -le 100 ]
+do
+ ./bsddialog --sleep 1 --title " mixedgauge " \
+ --mixedgauge "Example..." 20 45 $mainperc \
+ "Label 1" " -1" \
+ "Label 2" " -2" \
+ "Label 3" " -3" \
+ "Label 4" " -4" \
+ "Label 5" " -5" \
+ "Label 6" " -6" \
+ "Label 7" " -7" \
+ "Label 8" " -8" \
+ "Label 9" " -9" \
+ "Label 10" " -10" \
+ "Label 11" " -11" \
+ "Label X" $perc
+
+ perc=`expr $perc + 20`
+ mainperc=`expr $mainperc + 10`
+done
diff --git a/contrib/bsddialog/examples_utility/msgbox.sh b/contrib/bsddialog/examples_utility/msgbox.sh
new file mode 100755
index 000000000000..cad3c9ecb72a
--- /dev/null
+++ b/contrib/bsddialog/examples_utility/msgbox.sh
@@ -0,0 +1,28 @@
+#!/bin/sh
+#-
+# SPDX-License-Identifier: CC0-1.0
+#
+# Written in 2021 by Alfonso Sabato Siciliano.
+#
+# To the extent possible under law, the author has dedicated all copyright
+# and related and neighboring rights to this software to the public domain
+# worldwide. This software is distributed without any warranty, see:
+# <http://creativecommons.org/publicdomain/zero/1.0/>.
+
+: ${BSDDIALOG_ERROR=255}
+: ${BSDDIALOG_OK=0}
+: ${BSDDIALOG_ESC=5}
+
+./bsddialog --title " msgbox " --msgbox "Hello World!" 6 20
+
+case $? in
+ $BSDDIALOG_ERROR )
+ exit 1
+ ;;
+ $BSDDIALOG_ESC )
+ echo "[ESC]"
+ ;;
+ $BSDDIALOG_OK )
+ echo "[OK]"
+ ;;
+esac
diff --git a/contrib/bsddialog/examples_utility/passwordbox.sh b/contrib/bsddialog/examples_utility/passwordbox.sh
new file mode 100755
index 000000000000..b43ef6f6b994
--- /dev/null
+++ b/contrib/bsddialog/examples_utility/passwordbox.sh
@@ -0,0 +1,34 @@
+#!/bin/sh
+#-
+# SPDX-License-Identifier: CC0-1.0
+#
+# Written in 2021 by Alfonso Sabato Siciliano.
+#
+# To the extent possible under law, the author has dedicated all copyright
+# and related and neighboring rights to this software to the public domain
+# worldwide. This software is distributed without any warranty, see:
+# <http://creativecommons.org/publicdomain/zero/1.0/>.
+
+: ${BSDDIALOG_ERROR=255}
+: ${BSDDIALOG_OK=0}
+: ${BSDDIALOG_CANCEL=1}
+: ${BSDDIALOG_ESC=5}
+
+FORM=$(./bsddialog --insecure --title " password " \
+ --passwordbox "Hello World!" 12 40 \
+3>&1 1>&2 2>&3 3>&-)
+
+case $? in
+ $BSDDIALOG_ERROR )
+ exit 1
+ ;;
+ $BSDDIALOG_ESC )
+ echo "[ESC]"
+ ;;
+ $BSDDIALOG_CANCEL )
+ echo "[Cancel]"
+ ;;
+ $BSDDIALOG_OK )
+ echo "[OK] $FORM"
+ ;;
+esac
diff --git a/contrib/bsddialog/examples_utility/passwordform.sh b/contrib/bsddialog/examples_utility/passwordform.sh
new file mode 100755
index 000000000000..874a185ee66f
--- /dev/null
+++ b/contrib/bsddialog/examples_utility/passwordform.sh
@@ -0,0 +1,39 @@
+#!/bin/sh
+#-
+# SPDX-License-Identifier: CC0-1.0
+#
+# Written in 2021 by Alfonso Sabato Siciliano.
+#
+# To the extent possible under law, the author has dedicated all copyright
+# and related and neighboring rights to this software to the public domain
+# worldwide. This software is distributed without any warranty, see:
+# <http://creativecommons.org/publicdomain/zero/1.0/>.
+
+: ${BSDDIALOG_ERROR=255}
+: ${BSDDIALOG_OK=0}
+: ${BSDDIALOG_CANCEL=1}
+: ${BSDDIALOG_ESC=5}
+
+FORMS=$(./bsddialog --insecure --title " passwordform " \
+ --passwordform "Example" 12 40 5 \
+ Password1: 0 0 "" 0 11 18 25 \
+ Password2: 1 0 "" 1 11 18 25 \
+ Password3: 2 0 "" 2 11 18 25 \
+ Password4: 3 0 "" 3 11 18 25 \
+ Password5: 4 0 "" 4 11 18 25 \
+3>&1 1>&2 2>&3 3>&-)
+
+case $? in
+ $BSDDIALOG_ERROR )
+ exit 1
+ ;;
+ $BSDDIALOG_ESC )
+ echo "[ESC]"
+ ;;
+ $BSDDIALOG_CANCEL )
+ echo "[Cancel]"
+ ;;
+ $BSDDIALOG_OK )
+ echo "[OK] $FORMS"
+ ;;
+esac
diff --git a/contrib/bsddialog/examples_utility/pause.sh b/contrib/bsddialog/examples_utility/pause.sh
new file mode 100755
index 000000000000..225549dddffb
--- /dev/null
+++ b/contrib/bsddialog/examples_utility/pause.sh
@@ -0,0 +1,36 @@
+#!/bin/sh
+#-
+# SPDX-License-Identifier: CC0-1.0
+#
+# Written in 2021 by Alfonso Sabato Siciliano.
+#
+# To the extent possible under law, the author has dedicated all copyright
+# and related and neighboring rights to this software to the public domain
+# worldwide. This software is distributed without any warranty, see:
+# <http://creativecommons.org/publicdomain/zero/1.0/>.
+
+: ${BSDDIALOG_ERROR=255}
+: ${BSDDIALOG_OK=0}
+: ${BSDDIALOG_CANCEL=1}
+: ${BSDDIALOG_TIMEOUT=4}
+: ${BSDDIALOG_ESC=5}
+
+./bsddialog --title " pause " --pause "Hello World!" 7 35 10
+
+case $? in
+ $BSDDIALOG_ERROR )
+ exit 1
+ ;;
+ $BSDDIALOG_ESC )
+ echo "[ESC]"
+ ;;
+ $BSDDIALOG_TIMEOUT )
+ echo "[TIMEOUT]"
+ ;;
+ $BSDDIALOG_CANCEL )
+ echo "[Cancel]"
+ ;;
+ $BSDDIALOG_OK )
+ echo "[OK]"
+ ;;
+esac
diff --git a/contrib/bsddialog/examples_utility/radiolist.sh b/contrib/bsddialog/examples_utility/radiolist.sh
new file mode 100755
index 000000000000..359473abf35e
--- /dev/null
+++ b/contrib/bsddialog/examples_utility/radiolist.sh
@@ -0,0 +1,38 @@
+#!/bin/sh
+#-
+# SPDX-License-Identifier: CC0-1.0
+#
+# Written in 2021 by Alfonso Sabato Siciliano.
+#
+# To the extent possible under law, the author has dedicated all copyright
+# and related and neighboring rights to this software to the public domain
+# worldwide. This software is distributed without any warranty, see:
+# <http://creativecommons.org/publicdomain/zero/1.0/>.
+
+: ${BSDDIALOG_ERROR=255}
+: ${BSDDIALOG_OK=0}
+: ${BSDDIALOG_CANCEL=1}
+: ${BSDDIALOG_ESC=5}
+
+ITEM=$(./bsddialog --title " radiolist " --radiolist "Hello World!" 15 30 5 \
+ "1 Name" "DESC 1 xyz" off \
+ "2 Name" "DESC 2 xyz" off \
+ "3 Name" "DESC 3 xyz" on \
+ "4 Name" "DESC 4 xyz" off \
+ "5 Name" "DESC 5 xyz" off \
+3>&1 1>&2 2>&3 3>&-)
+
+case $? in
+ $BSDDIALOG_ERROR )
+ exit 1
+ ;;
+ $BSDDIALOG_ESC )
+ echo "[ESC]"
+ ;;
+ $BSDDIALOG_CANCEL )
+ echo "[Cancel]"
+ ;;
+ $BSDDIALOG_OK )
+ echo "[OK] $ITEM"
+ ;;
+esac
diff --git a/contrib/bsddialog/examples_utility/rangebox.sh b/contrib/bsddialog/examples_utility/rangebox.sh
new file mode 100644
index 000000000000..9b3213d8acad
--- /dev/null
+++ b/contrib/bsddialog/examples_utility/rangebox.sh
@@ -0,0 +1,33 @@
+#!/bin/sh
+#-
+# SPDX-License-Identifier: CC0-1.0
+#
+# Written in 2023 by Alfonso Sabato Siciliano.
+#
+# To the extent possible under law, the author has dedicated all copyright
+# and related and neighboring rights to this software to the public domain
+# worldwide. This software is distributed without any warranty, see:
+# <http://creativecommons.org/publicdomain/zero/1.0/>.
+
+: ${BSDDIALOG_ERROR=255}
+: ${BSDDIALOG_OK=0}
+: ${BSDDIALOG_CANCEL=1}
+: ${BSDDIALOG_ESC=5}
+
+VALUE=$(./bsddialog --title " rangebox " --rangebox "Hello World!" 7 35 0 10 5 \
+3>&1 1>&2 2>&3 3>&-)
+
+case $? in
+ $BSDDIALOG_ERROR )
+ exit 1
+ ;;
+ $BSDDIALOG_ESC )
+ echo "[ESC]"
+ ;;
+ $BSDDIALOG_CANCEL )
+ echo "[Cancel]"
+ ;;
+ $BSDDIALOG_OK )
+ echo "[OK] Value: $VALUE"
+ ;;
+esac
diff --git a/contrib/bsddialog/examples_utility/timebox.sh b/contrib/bsddialog/examples_utility/timebox.sh
new file mode 100755
index 000000000000..233434b29195
--- /dev/null
+++ b/contrib/bsddialog/examples_utility/timebox.sh
@@ -0,0 +1,33 @@
+#!/bin/sh
+#-
+# SPDX-License-Identifier: CC0-1.0
+#
+# Written in 2021 by Alfonso Sabato Siciliano.
+#
+# To the extent possible under law, the author has dedicated all copyright
+# and related and neighboring rights to this software to the public domain
+# worldwide. This software is distributed without any warranty, see:
+# <http://creativecommons.org/publicdomain/zero/1.0/>.
+
+: ${BSDDIALOG_ERROR=255}
+: ${BSDDIALOG_OK=0}
+: ${BSDDIALOG_CANCEL=1}
+: ${BSDDIALOG_ESC=5}
+
+TIME=$(./bsddialog --title " timebox " --timebox "Hello World!" 8 25 \
+3>&1 1>&2 2>&3 3>&-)
+
+case $? in
+ $BSDDIALOG_ERROR )
+ exit 1
+ ;;
+ $BSDDIALOG_ESC )
+ echo "[ESC]"
+ ;;
+ $BSDDIALOG_CANCEL )
+ echo "[Cancel]"
+ ;;
+ $BSDDIALOG_OK )
+ echo "[OK] $TIME"
+ ;;
+esac
diff --git a/contrib/bsddialog/examples_utility/yesno.sh b/contrib/bsddialog/examples_utility/yesno.sh
new file mode 100755
index 000000000000..d384086657e6
--- /dev/null
+++ b/contrib/bsddialog/examples_utility/yesno.sh
@@ -0,0 +1,32 @@
+#!/bin/sh
+#-
+# SPDX-License-Identifier: CC0-1.0
+#
+# Written in 2021 by Alfonso Sabato Siciliano.
+#
+# To the extent possible under law, the author has dedicated all copyright
+# and related and neighboring rights to this software to the public domain
+# worldwide. This software is distributed without any warranty, see:
+# <http://creativecommons.org/publicdomain/zero/1.0/>.
+
+: ${BSDDIALOG_ERROR=255}
+: ${BSDDIALOG_YES=0}
+: ${BSDDIALOG_NO=1}
+: ${BSDDIALOG_ESC=5}
+
+./bsddialog --title " yesno " --yesno "Hello World!" 6 25
+
+case $? in
+ $BSDDIALOG_ERROR )
+ exit 1
+ ;;
+ $BSDDIALOG_ESC )
+ echo "[ESC]"
+ ;;
+ $BSDDIALOG_NO )
+ echo "[NO]"
+ ;;
+ $BSDDIALOG_YES )
+ echo "[YES]"
+ ;;
+esac