bells and beeps

Chris Lewis clewis at ferret.ocunix.on.ca
Wed May 15 04:41:25 AEST 1991


In article <May.13.12.56.58.1991.1079 at pilot.njin.net> ratzan at pilot.njin.net (Lee Ratzan) writes:
>we are novice unix users running a hewlett-packard 9000/835 under
>hp-ux (a berkeley and at &tt unix hybrid. how do we activate
>a keyboard beep from within a korn shell script? the idea is
>to warn users of invalid entries before the screen clears.

Others will suggest echoing a control-G.  Which works on most terminals.
Most versions of UNIX (at least, ATT'ish ones) have a generic interface to
terminals called terminfo, in which each type of terminal is described
so that various applications can figger out how to control the terminal.
With terminfo, there is a command called "tput".  A slightly more generic
solution to getting a beep would be to call:
	tput bel
Which consults the database and emits the sequence required to get a bell.
Tho, in some cases, people have redefined it to do other "obvious" things.
(eg: inverse flash the screen - eugh ;-)

You can use tput to emit other things too without having to know the
interface to the terminal.
-- 
Chris Lewis, Phone: (613) 832-0541, Domain: clewis at ferret.ocunix.on.ca
UUCP: ...!cunews!latour!ecicrl!clewis; Ferret Mailing List:
ferret-request at eci386; Psroff (not Adobe Transcript) enquiries:
psroff-request at eci386 or Canada 416-832-0541.  Psroff 3.0 in c.s.u soon!



More information about the Comp.unix.questions mailing list