#!/usr/bin/awk -f #/afs/tu-chemnitz.de/gnu/@sys/bin/gawk -f # CGI-Anfrage: Holen einer WAV-Datei von großer Festplatte function Fehler(s) { # Fehler (als richtiges text/html) zum Client ausgeben und Programmende printf("Content-type: text/html\n\n"); printf("
\n",s); printf("\n"); exit(1); } BEGIN { info=ENVIRON["PATH_INFO"]; if (info ~ /[*;<>|&`"']/) { Fehler("Hack-Versuch abgelehnt!"); } kdo="wget -qO- ftp://nihonjin:gaikokugo@134.109.112.9/buchtext/wav" info; print "Content-type: audio/wav\n" print info print kdo FS=RS; ORS=""; do { if (!(kdo | getline)) break; print $0 RT; }while (1); }