--- /dev/null
+# The ultimate Makefile for ... beep!
+# By Alex Barton, alex@barton.de
+# Last changes: 2003-04-09
+
+PREFIX = /usr/local
+
+CFLAGS = -Wall -ansi -pedantic
+LDFLAGS =
+
+BINDIR = $(PREFIX)/bin
+
+all: beep
+
+beep: beep.o
+ $(CC) beep.o $(LDFLAGS) -o beep
+
+beep.o: beep.c
+ $(CC) -c $(CFLAGS) beep.c
+
+clean:
+ rm -f core *.o beep
+
+install: beep
+ cp beep $(BINDIR)/beep
+ chmod 4755 $(BINDIR)/beep
+
+# -eof-
--- /dev/null
+/*
+ * beep.c -- Let's beep a little bit ;-)
+ * Written by Alex Barton, alex@barton.de, 2000-11-18
+ * Last changes: 2003-04-09, alex
+ */
+
+#define COUNT 3
+
+#include <errno.h>
+#include <stdio.h>
+#include <unistd.h>
+#include <string.h>
+
+int main( void )
+{
+ FILE *fd;
+ int i = 0;
+
+ fd = fopen( "/dev/console", "w" );
+ if( ! fd )
+ {
+ /* Oops, Fehler ... */
+ printf( "Can't open /dev/console: %s\n", strerror( errno ));
+ return 1;
+ }
+
+ /* Ok, Datei (Device) geƶffnet ... */
+ while( i < COUNT )
+ {
+ fputs( "\x07", fd );
+ fflush( fd );
+ i++;
+ if( i >= COUNT ) break;
+ sleep( 1 );
+ }
+ fclose( fd );
+
+ return 0;
+} /* main */
+
+/* -eof- */