[comp.text] self-reproducing programs

lwall@sdcrdcf.UUCP (Larry Wall) (05/06/87)

Keywords:


#!/bin/sh

# Okay, as long as we're back into self-reproducing programs, here's the
# shortest self-reproducing nroff script (that doesn't cheat) that I have
# been able to come up with.

# (Cheating is to use no . or ' commands, or to .so your input file.)

# If you come up with a shorter one, I want to see it!

echo Extracting self.n
sed 's/X//' >self.n <<'!STUFFY!FUNK!'
X.ec8
X.emZZ
X.nryy1000-12
X.nrzz100-1
X.nf
X.deXX
X.tr88n(yy
X88!88!88$1
X.tr88n(zz
X.amZZ..
X88!88!.XX88$1
X.nrnl0-1
X...
X..
X.XX.ec9
X.XX.emZZ
X.XX.nryy1000-12
X.XX.nrzz100-1
X.XX.nf
X.XX.deXX
X.XX.tr99n(yy
X.XX99!99!99$1
X.XX.tr99n(zz
X.XX.amZZ..
X.XX99!99!.XX99$1
X.XX.nrnl0-1
X.XX...
X.XX..
!STUFFY!FUNK!
exit

Larry Wall
{allegra,burdvax,cbosgd,hplabs,ihnp4,sdcsvax}!sdcrdcf!lwall