Barth
Barth

Reputation: 15715

How to emit a "beep" on my computer while running a script on a remote machine?

I run a long script on a remote machine and I would like to hear a beep when the script ends. On my machine I can add at the end of the script:

echo -e '\a' > /dev/console

but this is not working on the remote machine which complains :

-bash: /dev/console: Permission denied

How to achieve this ?

Upvotes: 5

Views: 3577

Answers (2)

blahdiblah
blahdiblah

Reputation: 34011

You could run the script by passing it as a parameter to ssh and then echo the beep locally:

ssh user@host /path/to/script; echo -e '\a' > /dev/console

Upvotes: 2

Perhaps you might use /dev/tty instead of /dev/console. (I don't know how ssh handle beeps, so maybe you should start a terminal emulator, e.g. ssh -X -f remotehost xterm).

Upvotes: 0

Related Questions