diff --git a/tui.bash b/tui.bash new file mode 100755 index 0000000..e71e96a --- /dev/null +++ b/tui.bash @@ -0,0 +1,28 @@ +ARG_A=$(whiptail --inputbox "Please enter the value for \"a\":" 10 50 --title "Quadratic Calculator" 3>&1 1>&2 2>&3) + +exitstatus=$? +if [ $exitstatus = 0 ]; then +echo "a =" $ARG_A +else +echo "User canceled input." +fi + +ARG_B=$(whiptail --inputbox "Please enter the value for \"b\":" 10 50 --title "Quadratic Calculator" 3>&1 1>&2 2>&3) + +exitstatus=$? +if [ $exitstatus = 0 ]; then +echo "b =" $ARG_B +else +echo "User canceled input." +fi + +ARG_C=$(whiptail --inputbox "Please enter the value for \"C\":" 10 50 --title "Quadratic Calculator" 3>&1 1>&2 2>&3) + +exitstatus=$? +if [ $exitstatus = 0 ]; then +echo "c =" $ARG_C +else +echo "User canceled input." +fi + +quadratic $ARG_A $ARG_B $ARG_C \ No newline at end of file