2006-12-01

Shell script music

Posted in Geek Stuff at 15:50

Well, it seems I have the dubious distinction of being one of
the few (if any) people to discover a way to play music using shell
script. Observe the following snippet:

/usr/bin/yes foo > /dev/dsp & SP="${!}"; sleep 1; kill
"$SP"
The more characters in the argument to /usr/bin/yes,
the lower the tone. The length of the sleep argument determines how
long the tone lasts, but a pre-constructed string of repeating
“foo\n” components will do just as well, though you need about a
thousand of them to last one second.

Bad Behavior has blocked 55 access attempts in the last 7 days.