xref: /freebsd/contrib/bsddialog/examples_utility/pause.sh (revision b077aed33b7b6aefca7b17ddb250cf521f938613)
1#!/bin/sh
2#-
3# SPDX-License-Identifier: CC0-1.0
4#
5# Written in 2021 by Alfonso Sabato Siciliano.
6#
7# To the extent possible under law, the author has dedicated all copyright
8# and related and neighboring rights to this software to the public domain
9# worldwide. This software is distributed without any warranty, see:
10#	<http://creativecommons.org/publicdomain/zero/1.0/>.
11
12: ${BSDDIALOG_ERROR=255}
13: ${BSDDIALOG_OK=0}
14: ${BSDDIALOG_CANCEL=1}
15: ${BSDDIALOG_TIMEOUT=4}
16: ${BSDDIALOG_ESC=5}
17
18./bsddialog --title " pause " --pause "Hello World!" 7 35 10
19
20case $? in
21	$BSDDIALOG_ERROR )
22		exit 1
23	;;
24	$BSDDIALOG_ESC )
25		echo "[ESC]"
26	;;
27	$BSDDIALOG_TIMEOUT )
28		echo "[TIMEOUT]"
29	;;
30	$BSDDIALOG_CANCEL )
31		echo "[Cancel]"
32	;;
33	$BSDDIALOG_OK )
34		echo "[OK]"
35	;;
36esac
37