dialog多个输入框Linux,linux运维,_请问linux的dialog设计对话框不同的对话框可以嵌套吗?如果可以的话怎么嵌套呢?,linux运维 - phpStudy...

请问linux的dialog设计对话框不同的对话框可以嵌套吗?如果可以的话怎么嵌套呢?

比如下面这段shell脚本代码的各个对话框都是彼此独立的,我想把它们一起放到一个大对话框离里去,但不知道怎么弄:

/bin/bash

yesno()

{

dialog --title "First screen" --backtitle "Test Program" --clear --yesno \

"Start this test program or not ? \nThis decesion have to make by you." 16 51

# yes is 0, no is 1 , esc is 255

result=$?

if [ $result -eq 1 ] ; then

exit 1;

elif [ $result -eq 255 ]; then

exit 255;

fi

username;

}

username()

{

cat /dev/null >/tmp/test.username

dialog --title "Second screen" --backtitle "Test Program" --clear --inputbox \

"Please input your username (default: hello) " 16 51 "hello" 2>/tmp/test.username

result=$?

if [ $result -eq 1 ] ; then

yesno;

elif [ $result -eq 255 ]; then

exit 255;

fi

password;

}

password()

{

cat /dev/null >/tmp/test.password

dialog --insecure --title "Third screen" --backtitle "Test Program" --clear --passwordbox \

"Please input your password (default: 123456) " 16 51 "123456" 2>/tmp/test.password

result=$?

if [ $result -eq 1 ] ; then

username;

elif [ $result -eq 255 ]; then

exit 255;

fi

occupation;

}

occupation()

{

cat /dev/null >/tmp/test.occupation

dialog --title "Forth screen" --backtitle "Test Program" --clear --menu \

"Please choose your occupation: (default: IT)" 16 51 3 \

IT "The worst occupation" \

CEO "The best occupation" \

Teacher "Not the best or worst" 2>/tmp/test.occupation

result=$?

if [ $result -eq 1 ] ; then

password;

elif [ $result -eq 255 ]; then

exit 255;

fi

finish;

}

finish()

{

dialog --title "Fifth screen" --backtitle "Test Program" --clear --msgbox \

"Congratulations! The test program has finished!\n Username: $(cat /tmp/test.username)\n Password: $(cat /tmp/test.password)\n Occupation: $(cat /tmp/test.occupation)" 16 51

result=$?

if [ $result -eq 1 ] ; then

occupation

elif [ $result -eq 255 ]; then

exit 255;

fi

}

yesno;

相关阅读:

json-RPC如何使用tcp

JS中设置Object.prototype.name=1后为何console.log(1.2.name)会输出1?

根据vue-cli改造多页架构,CSS无法提取公共模块

ajax错误信息 {readyState: 4, status: 200, statusText: "load"}

在Visual Studio中创建的网站项目,怎么部署到本机的IIS上呢?怎么才能用IIS上设置的远程虚拟目录呢?在线等……

两个页面,a页面添加内容然后提交到后端,跳转到b页面查看内容,中间js是什么流程?

RESTful中登录接口怎么命名呢?

为什么用python模拟手机浏览器不生效,但是在iphone有用safari就生效?

ms-duplex 里如何写入变量

vue中使用第三方库muse-ui,总是提示无法组件注册失败,确认已提供name..

js json 对象 全文搜索

python中通过cx_Oracle查询表中字段报错,不能用desc tablename吗?请大神赐教啊!

svg 怎么应用 CSS3 的过渡效果,实现 path 路径的平滑过渡??

Redis配置主从不生效.

TextInputLayout的空白显示问题

chrome浏览器input框输入问题

Node中如何正确使用MySQL的连接池?

ES6 对象解构赋值问题

使用git help 时如果让帮助信息直接在当前窗口显示?

$.get,$.post,$.ajax三者有什么区别?

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值