Tested out dialog a bit
This commit is contained in:
22
Labb7/test_dialog_inputbox.sh
Executable file
22
Labb7/test_dialog_inputbox.sh
Executable file
@@ -0,0 +1,22 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Jack-Benny Persson
|
||||
# LX13
|
||||
# Testing inputboxes
|
||||
|
||||
# Binaries
|
||||
Dialog="/usr/bin/dialog"
|
||||
|
||||
# Santiy check
|
||||
if [ ! -x $Dialog ]; then
|
||||
echo "Can't execute $Dialog"
|
||||
exit 2
|
||||
fi
|
||||
|
||||
# Main
|
||||
$Dialog --inputbox "Your name" 10 60 2> /tmp/namefrombox
|
||||
Name=`cat /tmp/namefrombox`
|
||||
|
||||
$Dialog --msgbox "Your name is $Name" 10 60
|
||||
|
||||
exit 0
|
Reference in New Issue
Block a user