【问题标题】:Bash yad ComboBox argument as an array [duplicate]Bash yad ComboBox 参数作为数组[重复]
【发布时间】:2020-09-05 12:29:57
【问题描述】:

yad 是否支持将数组作为参数发送到 ComboBox 字段?

例子:

yad --form --field="ComboBox:CB" One\!Two\!Three

我可以让它与数组一起使用吗?

array=(one two three)
yad --form --field="ComboBox:CB" $array

【问题讨论】:

标签: bash zenity yad


【解决方案1】:

yad 本身不支持将数组作为 ComboBox 的输入。您必须将数组转换为 ! 分隔的字符串。

您可以通过临时修改 IFS 变量来做到这一点,如下所示:

array=(one two three)
yad --form --field="ComboBox:CB" $(IFS=! ; echo "${array[*]}")

【讨论】:

    猜你喜欢
    • 2013-07-07
    • 2016-02-23
    • 2020-12-31
    • 1970-01-01
    • 1970-01-01
    • 2015-12-02
    • 2019-04-09
    • 2021-03-29
    • 1970-01-01
    相关资源
    最近更新 更多