11

While i'm connected to a server via ssh, i want to be alerted for some events. BUT not via email.

I would rather use beep for that alert.

However, if i put beep as a reaction, it will beep on server which of course i can't hear :D

Is there any way to get alert, simply, and not by using email or any other complex alerting system?

6

Create alias for beep to echo -en "\007" (beep (bell) character)

Normally beep is using your pc speaker, not terminal bell

  • 1
    I'm afraid you didn't understand what i need. I'm connected from my local PC to a server via ssh. The terminal is always open although i don't watch what is going on there. I want to be warned with beep when something happens there. However, if i run beep on remote server after some event that i catch, it will beep on server WHICH IS in another country :) – mariotanenbaum Apr 19 '13 at 7:29
  • Yes, I understand. Set bell in your terminal emulator (wich you use for ssh connection, and execute echo -en "\007"). You should hear bell. – Marek Wajdzik Apr 19 '13 at 7:41
  • Hm, it doesn't work. If i understood you correctly, i create alias alias beep='echo -en "\007"' locally, connect to a remote server, and whatever beep happens on remote server, i'll hear that on my local machine? – mariotanenbaum Apr 19 '13 at 7:47
  • Yes, If your terminal is configured correctly then it will play sound or flash screen – Marek Wajdzik Apr 19 '13 at 7:52
  • 1
    I don't use putty... – mariotanenbaum Apr 19 '13 at 8:00
2

This worked for me on both OSX and a remote unix server, beeping through the normal sound output: echo -e '\a'

beep(){ echo -e '\a';}
beep
sleep 5 & beep # beeps now
sleep 5; beep # beep in 5s
# same thing using ruby -e 'sleep 5'

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.