Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
后台有限任务的最终结果:
( wget google.com && zenity --info || zenity --error ) & PID=$! ...if ... kill $PID ...zenity ...
他为什么不行动?应该怎样才好?
[编辑:] 已修复,谢谢。
使用您发布的内容,wget在后台开始,但zenity不是,它在wget启动后立即运行。所以它根本没有机会获得wget' 的返回值:wget还没有完成!
wget
zenity
尝试类似:
( wget google.com && zenity --info || zenity --error ) & PID=$! if ... kill $PID ...zenity ...