答案1
不,你不能在 bash 中创建 GUI。不过,您可以进行基于菜单的交互:熟悉命令select
。
这是一个例子:
PS3='What do you want to do [1-4]> '
select choice in "Join" "Sign In" "Sign Out" "Exit"; do
case $choice in
Join)
join_command
break ;;
"Sign In")
sign_in_command
break ;;
"Sign Out")
sign_out_command
break ;;
Exit)
echo "kthxbye"
exit ;;
esac
done
看起来像
1) Join
2) Sign In
3) Sign Out
4) Exit
What do you want to do [1-4]>