我有这个for循环(使用一个slooow命令),它花费了很多时间来列出东西。现在,如果我把它传递给zenity --list
,那么好的是它不会等到收到完整列表(比如3分钟)但是马上开始填写:)
问题是,在那之后,我似乎无法在变量中输出输出的内容(用户选择的列表行并按RETURN
,或单击OK UPON)。考虑:
for i in {1..12}; do
echo "A row"
echo "Another row"
done | zenity --list --print-column=ALL --separator="|" --title="All the plugins" --column="Type" --column="Name" --column="URL"
#Select a row returns =>
Another row|A row|Another row|Another row|A row|Another row
for i in {1..12}; do
echo "A row"
echo "Another row"
done | testvar=$(zenity --list --print-column=ALL --separator="|" --title="All the plugins" --column="Type" --column="Name" --column="URL")
echo $testvar
#Select a row returns =>
(nothing)
Nb 此问题不重复。请考虑实时部分。我无法等待我的循环结束以获得结果,我需要立即填写列表。这可能是一个zenity错误和BTW我知道我管道意味着一个子shell。