Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10 5/3/83; site umcp-cs.UUCP Path: utzoo!watmath!clyde!burl!ulysses!mhuxl!houxm!houxz!vax135!cornell!uw-beaver!tektronix!hplabs!hao!seismo!rlgvax!cvl!umcp-cs!chris From: chris@umcp-cs.UUCP Newsgroups: net.unix-wizards Subject: Re: /bin/sh feature? (and, Fun With #! Lines) Message-ID: <7977@umcp-cs.UUCP> Date: Fri, 27-Jul-84 00:25:04 EDT Article-I.D.: umcp-cs.7977 Posted: Fri Jul 27 00:25:04 1984 Date-Received: Mon, 23-Jul-84 01:44:42 EDT References: <7@ism780b.UUCP> <150@godot.UUCP> <754@hcrvax.UUCP> Organization: Univ. of Maryland, Computer Science Dept. Lines: 39 One annoying thing about using quoted ``hereis document'' terminators is that /bin/sh and /bin/csh demand different conventions. If you are using /bin/sh, you must NOT quote the terminator. For example, #! /bin/sh cat << 'eof' Hi there. eof HOWEVER, if you are using /bin/csh, you HAVE to quote the terminator (and moreover, in the same way as the original). The script #! /bin/csh cat << \eof Hi. I'll bet you're expecting this to be the only line. eof 'e'of \eof prints THREE lines. [Of course, there's always the self-catting awk script: #! /bin/awk NR > 1 { print } is an executable (4BSD anyway) file which prints itself, except for the first line. For more fun, try these scripts: #! /bin/rm #! /bin/mv Got any other interesting scripts?] -- In-Real-Life: Chris Torek, Univ of MD Comp Sci (301) 454-7690 UUCP: {seismo,allegra,brl-bmd}!umcp-cs!chris CSNet: chris@umcp-cs ARPA: chris@maryland