Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!hp-col!hpldola!hp-lsd!jimr@hplsdv7.COS.HP.COM From: jimr@hplsdv7.COS.HP.COM (Jim Rogers) Newsgroups: comp.unix.questions Subject: Re: bells and beeps Message-ID: <7370028@hplsdv7.COS.HP.COM> Date: 14 May 91 15:17:53 GMT References: Organization: HP Logic Systems Division - Col Lines: 31 >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. > >your assistance is appreciated. > >thanx, > >lee ratzan >univ of medicine and dentistry of nj The simple answer is to use a control-G. This will work in most cases. The more general solution is to use the "tput" command and the terminfo database (see man pages for "tput (1)" and "terminfo (4)"). The use of tput allows the user to be on a wide array of terminal types and still have the desired response by his/her terminal. For the "beep" use the following mthod in your Korn shell: beep=`tput bel` print "${beep}" Similar capabilities can be defined for text attributes (i.e. bold, normal), cursor movement (i.e. home cursor, cursor down, cursor up), clear to end of line or clear to end of screen, and so forth. Jim Rogers Hewlett-Packard Company