Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/freebsd-src
Path: blob/main/contrib/bsddialog/examples_utility/slider.sh
96290 views
1
#!/bin/sh
2
#-
3
# SPDX-License-Identifier: CC0-1.0
4
#
5
# Written in 2025 by Braulio Rivas.
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_ESC=5}
16
17
STARTEND=$(./bsddialog --slider "Choose a new partition location" 0 0 MiB \
18
30000 5000 6000 0 1000 3000 25000 30000 \
19
3>&1 1>&2 2>&3 3>&-)
20
21
case $? in
22
$BSDDIALOG_ERROR )
23
exit 1
24
;;
25
$BSDDIALOG_ESC )
26
echo "[ESC]"
27
;;
28
$BSDDIALOG_CANCEL )
29
echo "[Cancel]"
30
;;
31
$BSDDIALOG_OK )
32
echo "[OK] $STARTEND"
33
;;
34
esac
35
36