Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site brl-tgr.ARPA Path: utzoo!linus!philabs!cmcl2!seismo!brl-tgr!gwyn From: gwyn@brl-tgr.ARPA (Doug Gwyn) Newsgroups: net.unix Subject: Re: Clunch protection Message-ID: <5382@brl-tgr.ARPA> Date: Thu, 18-Oct-84 18:24:34 EDT Article-I.D.: brl-tgr.5382 Posted: Thu Oct 18 18:24:34 1984 Date-Received: Sat, 20-Oct-84 06:49:58 EDT References: <205@itm.UUCP> <5312@brl-tgr.ARPA> <4027@elsie.UUCP> Organization: Ballistic Research Lab Lines: 37 > 1. The "#!/bin/sh" line lacks a space or tab between the "#!" and the > "/bin/sh". > > 2. The "#!" construct is not recognized on all UNIX systems. > > 3. Even if the "#!/bin/sh" line is present at the start of a shell script, > "/bin/sh" will NOT be used to interpret the script if the script is > executed using the command > csh script 1. The documentation was wrong; white space was optional all along. Later versions of the documentation have been corrected. Only LOCUS chose to force you to use white space, so far as I am aware. By all means stick in a space if it makes you happier. 2. On most systems where the kernel does not understand the #! magic number, the first line of the script will be taken as a comment and the Bourne shell /bin/sh will be used to interpret the script anyway. 7th Edition UNIXes that never upgraded their shells may break. Also, systems where the Cshell was imported with insufficient care may let the Cshell handle the script rather than either defaulting to the native shell or examining the #! line to see what to use. 3. Of course csh script will use the wrong shell! So will ed script or many other similar commands. 4. If one has to allow for || && vs && ||, lack of # comments, and zillions of other variations, then immense pains are required to produce anything close to a "portable" shell script that will either run correctly or detect that it has been misinvoked. The example that started this discussion took great pains but still had loopholes; the practicality of this approach is questionable. It is perhaps easier to give somebody a new shell than it is to accommodate WHATEVER he might already have.