TCLUG Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [TCLUG:1420] how do I make a beep?
Andrew McCulloh wrote:
>
> >>>>> "Bob" == Bob Tanner <tanner@real-time.com> writes:
>
> Bob> Quoting Andrew McCulloh (mcculloh@2z.net):
> >> There are more direct ways to do this. The "real" unix way is
> >> to write a program that reads the utmp file. Have a look at the
> >> utmp(5) and getutent(3) man pages for info on how to get
> >> information out of utmp. A copy of stevens' Advanced Progamming
> >> the UNIX Environment will come in handy if you want to send
> >> signals to other peoples tty's.
>
> Bob> The above is this "Microsoft" or "Windows" way. Why re-invent
> Bob> the wheel? Use the tools that are at hand and the simplest
> Bob> solution.
>
> Bob> From the posting you can tell the individual is not a systems
> Bob> program, why have them jump into signal handling, ptys, slave
> Bob> ptys and the works? Sheesh...
>
> Hey now, that's not very pleasant. Sure there are many ways to do
> this. I personally don't recommend the utmp method unless you are
> willing to sit down w/ gcc, read lots of man pages, and become best
> friends with the debugger. But to each their own, the beauty of unix
> vs. widows is that there is more than one way to do things. And, if you
> want to learn more about the system, you can dig as deep as you like.
>
> Andrew
>
> p.s. the simplest way to do this involves a couple line shell script
> that calls who & cut or awk...
And 3 lines of C is how many lines too many?
> SOS:src=> cat beep.c
> #include <stdio.h>
> main ()
> {printf("\a");}
> SOS:src=> cc -o a.out beep.c
> SOS:src=> ./a.out
> SOS:src=>
-sos