home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / alt / hackers / 1364 < prev    next >
Encoding:
Text File  |  1992-09-03  |  1.3 KB  |  40 lines

  1. Newsgroups: alt.hackers
  2. Path: sparky!uunet!stan!imp
  3. From: imp@solbourne.com (Warner Losh)
  4. Subject: Re: Self Printing Program, revisited
  5. Message-ID: <Bu296o.4rJ@solbourne.com>
  6. Organization: Solbourne, User Interface Group
  7. References: <9lm-wK-@engin.umich.edu> <1992Sep4.083327.15563@jarvis.csri.toronto.edu>
  8. Date: Fri, 4 Sep 1992 15:47:12 GMT
  9. Approved: yes
  10. Lines: 28
  11.  
  12. In article <1992Sep4.083327.15563@jarvis.csri.toronto.edu>
  13. flaps@dgp.toronto.edu (Alan J Rosenthal) writes:
  14. >Well, is "cat" a self printing program because you can do
  15. >    cat /usr/src/bin/cat.c
  16. >?  "Cat" is not an extremely exciting or novel program.  Your program is less
  17. >exciting than cat.
  18.  
  19. I still like the solution for this in a scripting language under unix:
  20.  
  21. #!/bin/cat
  22.  
  23. It is almost cheating, but not quite.  It is certainly more novel than
  24. the other solution just presented.
  25.  
  26. There is a shorter version if you do it completely in shell:
  27. ----------------------- cut here -------------------------------
  28. ----------------------- cut here -------------------------------
  29.  
  30. An empty shell script will produce no output and compare the same to
  31. the original.
  32.  
  33. I'm sure that the shortest perl version of this program is even
  34. shorter :-)
  35.  
  36. Warner
  37. -- 
  38. Warner Losh        imp@Solbourne.COM
  39. I've almost finished my brute force solution to subtlety.
  40.