X-Git-Url: https://git.josue.xyz/?p=whiptailexamples%2F.git;a=blobdiff_plain;f=inputbox.sh;fp=inputbox.sh;h=db0d1d5fc56de5e35c0032bf1a508ac58f0a3658;hp=0000000000000000000000000000000000000000;hb=4eb1a6e1220dee809c089a0a7db1f22a1277c8e0;hpb=e38cc981105fb88c40c6e287900fb8a2537d3c29 diff --git a/inputbox.sh b/inputbox.sh new file mode 100755 index 0000000..db0d1d5 --- /dev/null +++ b/inputbox.sh @@ -0,0 +1,9 @@ +#!/bin/bash +PET=$(whiptail --title "Test Free-form Input Box" --inputbox "What is your pet's name?" 10 60 Wigglebutt 3>&1 1>&2 2>&3) + +exitstatus=$? +if [ $exitstatus = 0 ]; then + echo "Your pet name is:" $PET +else + echo "You chose Cancel." +fi