home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: alt.hackers
- Path: sparky!uunet!stan!imp
- From: imp@solbourne.com (Warner Losh)
- Subject: Re: Self Printing Program, revisited
- Message-ID: <Bu296o.4rJ@solbourne.com>
- Organization: Solbourne, User Interface Group
- References: <9lm-wK-@engin.umich.edu> <1992Sep4.083327.15563@jarvis.csri.toronto.edu>
- Date: Fri, 4 Sep 1992 15:47:12 GMT
- Approved: yes
- Lines: 28
-
- In article <1992Sep4.083327.15563@jarvis.csri.toronto.edu>
- flaps@dgp.toronto.edu (Alan J Rosenthal) writes:
- >Well, is "cat" a self printing program because you can do
- > cat /usr/src/bin/cat.c
- >? "Cat" is not an extremely exciting or novel program. Your program is less
- >exciting than cat.
-
- I still like the solution for this in a scripting language under unix:
-
- #!/bin/cat
-
- It is almost cheating, but not quite. It is certainly more novel than
- the other solution just presented.
-
- There is a shorter version if you do it completely in shell:
- ----------------------- cut here -------------------------------
- ----------------------- cut here -------------------------------
-
- An empty shell script will produce no output and compare the same to
- the original.
-
- I'm sure that the shortest perl version of this program is even
- shorter :-)
-
- Warner
- --
- Warner Losh imp@Solbourne.COM
- I've almost finished my brute force solution to subtlety.
-