在后台执行命令,并在执行完成时收到通知

如何确保在工作完成后得到通知?

这是我正在运行的:

$ time find -exec chmod or '{}' \+& 

我想知道工作完成多久,并通知完成。

我想这样做:

 $ time ls -l 2>&1 | write buttlebutkus pts/0& 

(用ls -l做一个快速testing)

但结果是有点weird 。 虽然它似乎本质上工作,但恐怕也许只是因为ls发送EOFwrite

编辑:

我只是试过这个:

 $ time find -exec chmod or '{}' \+ 2>&1 | write buttlebutkus pts/0& 

现在我看到数百万页的输出,不能用ctrl-z或ctrl-c离开它。

 $ time find -exec chmod or '{}' \+ 2>&1 && write buttlebutkus pts/0 & 

man bash

  The control operators && and ││ denote AND lists and OR lists, respectively. An AND list has the form command1 && command2 command2 is executed if, and only if, command1 returns an exit status of zero.