QOTD server (Re: Help with socket 'select')
Alexander Dupuy
dupuy at cs.columbia.edu
Thu Nov 23 04:00:02 AEST 1989
In article <13937 at orstcs.CS.ORST.EDU> Paul O'Neill writes:
> Only a few hosts in the NIC host tables advertise supporting QOTD service.
> (Quote of the day.) This should change that!!
>
> [perl script deleted]
>
> ps -- Just for giggles, try a
>
> telnet sapphire.oce.orst.edu 17
Why is it that everybody thinks perl is great for everything. I'm sure it has
its uses, but its only one tool - there are lots of others. Here's a simpler
version of the same thing that doesn't require perl, weird perl socket support,
or a separate deamon process:
$ grep quote /etc/inetd.conf
quote stream tcp nowait nobody /usr/local/etc/in.qotdd in.quotdd
$ cat /usr/local/etc/in.quotdd
#!/bin/sh
#!/bin/sh
exec 1>&0 2>&0
echo ''
PATH=$PATH:/usr/games
exec "${@-/usr/games/fortune}"
$
What could be simpler? And besides, it works:
$ telnet sapphire.oce.orst.edu 17
Trying 128.193.64.35 ...
telnet: connect: Connection refused
telnet> open localhost 17
Trying 127.0.0.1 ...
Connected to localhost.columbia.edu.
Escape character is '^]'.
Ken Thompson has an automobile which he helped design. Unlike most
automobiles, it has neither speedometer, nor gas gage, nor any of the
numerous idiot lights which plague the modern driver. Rather, if the
driver makes any mistake, a giant "?" lights up in the center of the
dashboard. "The experienced driver", he says, "will usually know
what's wrong."
Connection closed by foreign host.
$
@alex
--
--
inet: dupuy at cs.columbia.edu
uucp: ...!rutgers!cs.columbia.edu!dupuy
More information about the Alt.sources
mailing list