简体   繁体   中英

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 ?

您可以通过将脚本作为参数传递给ssh来运行脚本,然后在本地回显提示音:

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

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, eg ssh -X -f remotehost xterm ).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM