beep to putty terminal from bash script - shell
This is a discussion on beep to putty terminal from bash script - shell ; Hi folks, I’m trying to write a script that at a certain condition it will beep, but not on the server itself but on my laptop using putty. The reason it needs to be like this is the server is ...
![]() |
| | LinkBack | Thread Tools | Display Modes |
|
#1
| |||
| |||
| I’m trying to write a script that at a certain condition it will beep, but not on the server itself but on my laptop using putty. The reason it needs to be like this is the server is in a remote site. I can get putty to beep when logged on the server by doing any of the following on the command line.. echo -e -n \\a echo -e "\007" tput bel But when I put them in the script I do not hear any beeps. I’m guess that the script does not know how to pass the beep back to my terminal I’m using on the pc. Does anybody know how to redirect these beeps back to my pc from the shell script? I’m using bash on linux. Cheers |
|
#2
| |||
| |||
|
On Thu, 16 Oct 2008 06:21:57 -0300, Ray > Hi folks, > > I’m trying to write a script that at a certain condition it will beep, > but not on the server itself but on my laptop using putty. The reason > it needs to be like this is the server is in a remote site. > > I can get putty to beep when logged on the server by doing any of the > following on the command line.. > > echo -e -n \\a > echo -e "\007" > tput bel > > But when I put them in the script I do not hear any beeps. > > I’m guess that the script does not know how to pass the beep back to > my terminal I’m using on the pc. > > Does anybody know how to redirect these beeps back to my pc from the > shell script? I’m using bash on linux. > > Cheers > A listener, micro_inetd: http://www.acme.com/software/micro_inetd/ In your workstation: $ cat /tmp/beep #!/bin/bash if [ "$1" = on ];then micro_inetd 55555 $0 & else echo -e '\a' >/dev/tty9 fi #Starting the listner: $ /tmp/beep on In the server's script (example): REMOTE=10.0.0.1/55555 rbeep(){ exec 3<>/dev/tcp/$REMOTE;exec 3<&-;} # Insert "rbeep" in the script's desired points. #You can do a serie of sounds to identify specific events, as: case $1 in none) ;;down) for f in {200..20};do echo -en "\e[10;${f}0]\a" >/dev/tty59;done esac The shell here is bash. |
|
#3
| |||
| |||
|
On Oct 16, 1:28*pm, mop2 > On Thu, 16 Oct 2008 06:21:57 -0300, Ray > > Hi folks, > > > I’m trying to write a script that at a certain condition it will beep, > > but not on the server itself but on my laptop using putty. The reason > > it needs to be like this is the server is in a remote site. > > > I can get putty to beep when logged on the server by doing any of the > > following on the command line.. > > > echo -e -n \\a > > echo -e "\007" > > tput bel > > > But when I put them in the script I do not hear any beeps. > > > I’m guess that the script does not know how to pass the beep back to > > my terminal I’m using on the pc. > > > Does anybody know how to redirect these beeps back to my pc from the > > shell script? I’m using bash on linux. > > > Cheers > > A listener, micro_inetd:http://www.acme.com/software/micro_inetd/ > > In your workstation: > > $ cat /tmp/beep > #!/bin/bash > if [ "$1" = on ];then > *micro_inetd 55555 $0 & > else > *echo -e '\a' >/dev/tty9 > fi > > #Starting the listner: > $ /tmp/beep on > > In the server's script (example): > REMOTE=10.0.0.1/55555 > rbeep(){ exec 3<>/dev/tcp/$REMOTE;exec 3<&-;} > > # Insert "rbeep" in the script's desired points. > > #You can do a serie of sounds to identify specific events, as: > case $1 in none) > ;;down) > for f in {200..20};do echo -en "\e[10;${f}0]\a" >/dev/tty59;done > esac > > The shell here is bash.- Hide quoted text - > > - Show quoted text - ok thanks i'll give it a go |
|
#4
| |||
| |||
|
On 2008-10-16 02:21, Ray > echo -e -n \\a > echo -e "\007" > tput bel > > But when I put them in the script I do not hear any beeps. > > I’m guess that the script does not know how to pass the beep backto > my terminal I’m using on the pc. The beep goes to the terminal connected with your stdout (probably your laptop). If you don't hear the beeps, it's either putty's or your system's fault. (I have never used putty.) If the client is Linux, you may have to 'modprobe pcspkr' to enable the PC speaker. Also, some notebooks disable the PC speaker by default (my Toshiba is an example), and you must enable it by the BIOS SETUP. -- VÃ*tor De Araújo http://huangho.net76.net |
|
#5
| |||
| |||
|
On Tue, 11 Nov 2008 14:38:59 -0200, VÃ*tor De Araújo >On 2008-10-16 02:21, Ray > >> echo -e -n \\a >> echo -e "\007" >> tput bel >> >> But when I put them in the script I do not hear any beeps. >> >> I’m guess that the script does not know how to pass the beep back to >> my terminal I’m using on the pc. > >The beep goes to the terminal connected with your stdout (probably >your laptop). If you don't hear the beeps, it's either putty's or your >system's fault. (I have never used putty.) If the client is Linux, you >may have to 'modprobe pcspkr' to enable the PC speaker. Also, some >notebooks disable the PC speaker by default (my Toshiba is an >example), and you must enable it by the BIOS SETUP. I have PuTTY set for 'visual beep' -- nothing worse than machines beeping at me And I get visual beep for vim: [esc] [esc], so you could try thatto see what the response to a beep is on your setup? Grant. -- http://bugsplatter.id.au |
![]() |
« Previous Thread
|
Next Thread »
| Thread Tools | |
| Display Modes | |
| |
All times are GMT -4. The time now is 10:31 PM.




And I get visual beep for vim: [esc] [esc], so you could try that
Linear Mode