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