dbaspot
Tags Register FAQ Calendar Search Today's Posts Mark Forums Read

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 ...


Home > Database Forum > Operating Systems > shell > beep to putty terminal from bash script

Reply

 

LinkBack Thread Tools Display Modes
  #1  
Old 10-16-2008, 05:21 AM
Database Bot
 
Join Date: Sep 2009
Posts: 1,236,254
Database Administrator is on a distinguished road
Default beep to putty terminal from bash script

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
Reply With Quote
  #2  
Old 10-16-2008, 08:28 AM
Database Bot
 
Join Date: Sep 2009
Posts: 1,236,254
Database Administrator is on a distinguished road
Default Re: beep to putty terminal from bash script

On Thu, 16 Oct 2008 06:21:57 -0300, Ray wrote:

> 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.


Reply With Quote
  #3  
Old 10-16-2008, 10:03 AM
Database Bot
 
Join Date: Sep 2009
Posts: 1,236,254
Database Administrator is on a distinguished road
Default Re: beep to putty terminal from bash script

On Oct 16, 1:28*pm, mop2 wrote:
> On Thu, 16 Oct 2008 06:21:57 -0300, Ray wrote:
> > 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
Reply With Quote
  #4  
Old 11-11-2008, 12:38 PM
Database Bot
 
Join Date: Sep 2009
Posts: 1,236,254
Database Administrator is on a distinguished road
Default Re: beep to putty terminal from bash script

On 2008-10-16 02:21, Ray wrote:

> 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
Reply With Quote
  #5  
Old 11-11-2008, 11:45 PM
Database Bot
 
Join Date: Sep 2009
Posts: 1,236,254
Database Administrator is on a distinguished road
Default Re: beep to putty terminal from bash script

On Tue, 11 Nov 2008 14:38:59 -0200, VÃ*tor De Araújo wrote:

>On 2008-10-16 02:21, Ray wrote:
>
>> 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 that
to see what the response to a beep is on your setup?

Grant.
--
http://bugsplatter.id.au
Reply With Quote
Reply

Thread Tools
Display Modes



All times are GMT -4. The time now is 10:31 PM.