代码: 全选
Second=$(dialog --nocancel --rangebox "$TextText" 2 40 1 30 3)
代码: 全选
Second=$(dialog --nocancel --rangebox "$TextText" 2 40 1 30 3)
代码: 全选
Second=$(dialog --nocancel --rangebox "$TextText" 2 40 1 30 3 2>&1 1>/dev/null)
Some widgets, e.g., checklist, will write text to dialog's output. Normally that is the standard error, but there are options for changing
this: "--output-fd", "--stderr" and "--stdout". No text is written if the Cancel button (or ESC) is pressed; dialog exits immediately in
that case.
嗯,就是这样。Russell_D_Lee 写了:由于使用$()可以把标准输出赋给变量,而我们可以重定向标准错误输出到标准输出,并且丢弃原标准输出的内容。
所以我只能想到:不知道是否有更优雅的方法。代码: 全选
Second=$(dialog --nocancel --rangebox "$TextText" 2 40 1 30 3 2>&1 1>/dev/null)