Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: notesfiles Path: utzoo!watmath!clyde!burl!ulysses!mhuxl!houxm!houxz!vax135!cornell!uw-beaver!tektronix!hplabs!hp-pcd!hpfcla!ajs From: ajs@hpfcla.UUCP (ajs) Newsgroups: net.unix-wizards Subject: Re: Re: /bin/sh feature? --- more lossag Message-ID: <43900013@hpfcla.UUCP> Date: Sat, 14-Jul-84 18:07:00 EDT Article-I.D.: hpfcla.43900013 Posted: Sat Jul 14 18:07:00 1984 Date-Received: Tue, 24-Jul-84 03:15:41 EDT References: <150@godot.UUCP> Organization: Hewlett-Packard - Fort Collins, CO Lines: 18 Nf-ID: #R:godot:-15000:hpfcla:43900013:000:901 Nf-From: hpfcla!ajs Jul 20 14:07:00 1984 > Yes, the backquote in inline input redirecton is active; it will try to > execute the hi command and lose. Sigh. Just for your amusement, a worse example of the same thing. Before I knew about quoted here-documents (who has time to reread the manual?), I wrote a shell script that, among other things, did an "at" from a here document. In the document was a line like: "rm -rf $dir/*". Now, $dir would be set when the at script (actually a shell script, of course) ran, but it was not set at the time that I ran the first shell script. Furthermore, I did not have set -u in effect, and I ran the shell script as root. Naturally the shell evaluated $dir to "". It was pure luck that I looked at the queued at script before it removed all the files on the disc. Nearly passed out when I saw: "rm -rf /*" in it. -- Alan (always quote your here documents) Silverstein