14

I'm using some Bash scripts under Linux that require some time to complete; I'd like to add at the end of them a command to ring the system bell when those tasks are done, so I can be notified.

What's the proper command to do that? (please note that what I need is to be notified, with a sound and possibly with a message, so I can accept any solution in these regards).

14

tputbel (GNU, Net-/OpenBSD)

or

tputbell (FreeBSD)

is a semi-portable solution.

  • "tput bel" works on macOS, as it should. – John Dallman Dec 14 '17 at 15:46
  • Works on Cygwin bash terminal as well. – ysap Aug 10 '18 at 17:25
9

Try this command:

echo -e "\07"
  • N.B. The -e is needed to enable interpretation of the \07 escape sequence. – FKEinternet Nov 27 '17 at 11:20
  • Works on Cygwin bash terminal as well. – ysap Aug 10 '18 at 17:25

protected by JakeGould Oct 25 '15 at 18:33

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

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