开发者

Make tcsh wait until specific background job ends + alert me

What "nonblocking" command makes tcsh wait until a specific background task completes and then "alerts" me by running a command of my choosing?

I want "wait %3 && xmessage job completed &" to wait until background job [3] is finished and then xmessage me "job completed", but want this co开发者_开发知识库mmand itself to return immediately, not "block" the terminal.

Obviously, my syntax above doesn't work. What does?

I've written a Perl program that can do this, but surely tcsh can do it natively?


You may be able to do something like (untested):

while (! $?)
    kill -s 0 $!
    sleep 1
end

Or take a look at the notify command. I'm not sure if it would do what you want.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜