1

This question is similar, but different of
How can I get an audio notification when a shell command have finished?
I am looking for a command that can be used like

sleep 2 &; sleep 1 &; sleep 5 &; sleep 3; bell

giving an audible notification after 5 seconds.

I use zsh in a KDE konsole.

0

How about

sleep 2 &; sleep 1 &; sleep 5 &; sleep 3 &; for job in `jobs -p` ; do wait $job ; done ; bell

(simplified from https://stackoverflow.com/questions/356100/how-to-wait-in-bash-for-several-subprocesses-to-finish-and-return-exit-code-0)?

Side note: I tested in GNU bash, Version 4.3.48 instead of zsh and used beep instead of bell. My actual command was slightly different:

sleep 2 & sleep 1 & sleep 5 & sleep 3 & for job in `jobs -p` ; do wait $job ; done ; beep
-1

You can use sleep 2 & sleep 1 & sleep 5 & wait; xkbbell -force. You may need to run modprobe pcspkr as root.

  • which shell supports single & there between commmads? – αғsнιη Jun 2 '18 at 16:58
  • @αғsнιη I am not sure there is any such shell, unless you're not joking. – argle Jun 3 '18 at 9:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.