2021-11-05 18:20:37 -04:00
|
|
|
#!/bin/sh
|
2021-11-05 18:42:58 -04:00
|
|
|
|
2021-11-05 18:20:37 -04:00
|
|
|
ARG_A=$(whiptail --inputbox "Please enter the value for \"a\":" 10 50 --title "Quadratic Calculator" 3>&1 1>&2 2>&3)
|
|
|
|
|
|
|
|
exitstatus=$?
|
2021-11-05 18:42:58 -04:00
|
|
|
if [ $exitstatus != 0 ]; then
|
2022-09-26 18:01:15 -04:00
|
|
|
echo "User cancelled input."
|
2021-11-05 18:20:37 -04:00
|
|
|
exit
|
|
|
|
fi
|
|
|
|
|
|
|
|
ARG_B=$(whiptail --inputbox "Please enter the value for \"b\":" 10 50 --title "Quadratic Calculator" 3>&1 1>&2 2>&3)
|
|
|
|
|
|
|
|
exitstatus=$?
|
2021-11-05 18:42:58 -04:00
|
|
|
if [ $exitstatus != 0 ]; then
|
2022-09-26 18:01:15 -04:00
|
|
|
echo "User cancelled input."
|
2021-11-05 18:20:37 -04:00
|
|
|
exit
|
|
|
|
fi
|
|
|
|
|
|
|
|
ARG_C=$(whiptail --inputbox "Please enter the value for \"c\":" 10 50 --title "Quadratic Calculator" 3>&1 1>&2 2>&3)
|
|
|
|
|
|
|
|
exitstatus=$?
|
2021-11-05 18:42:58 -04:00
|
|
|
if [ $exitstatus != 0 ]; then
|
2022-09-26 18:01:15 -04:00
|
|
|
echo "User cancelled input."
|
2021-11-05 18:20:37 -04:00
|
|
|
exit
|
|
|
|
fi
|
|
|
|
|
2021-11-05 18:34:05 -04:00
|
|
|
quadratic $ARG_A $ARG_B $ARG_C
|