Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!rutgers!mit-eddie!uw-beaver!ssc-vax!ray3rd From: ray3rd@ssc-vax.UUCP (Ray E Saddler III) Newsgroups: comp.unix.questions Subject: Re: Why does this shell program run under csh???? Message-ID: <1270@ssc-vax.UUCP> Date: Tue, 2-Jun-87 11:04:02 EDT Article-I.D.: ssc-vax.1270 Posted: Tue Jun 2 11:04:02 1987 Date-Received: Sat, 6-Jun-87 18:45:20 EDT References: <243@kosman.UUCP> Organization: Boeing Aerospace Corp., Seattle WA Lines: 44 Summary: These fixes work every time on UNIX 4.2 In article <243@kosman.UUCP>, kevin@kosman.UUCP (Kevin O'Gorman) writes: > I am running Ultrix 1.2A (a Berkely type thing) and have written two shell > programs: > > .....(other information about his shell scripts)..... > > -- > Kevin O'Gorman > ...{decvax,allegra}!philabs!hhb!kosman!kevin Some time ago I wrote some shell scripts to run in /bin/sh, and for some reason, they ran in /bin/csh. The fix is to insert a line at the beginning of the script: #!/bin/sh This, for some [magic] reason, forces the script file to run under the Bourne shell. Maybe some guru/wizard/hacker out ther can elaborate on why this happens. All I know (and care about) is that it works! ;) Also, another thing that works is to insert 1 space before your first word in the script: echo "Super Script: POWERBACK" echo " " echo "Another marvelous script written by ME" .. .. .. all the things that the script does .. .. exit 0 Give them a try! If they don't work, well, it's due to some unique feature/bug about Ultrix that I'm not familiar with! -- Ray E. Saddler III CAD Support and Administration | __ __ __ __ Boeing Aerospace Company Ballistic Systems Division | / / / // //| // P.O. Box 3999 M.S. 3R-05 Kent Space Center East | /-< / //- // |// _ Seattle, Wa. 98124 USA (206)657-2824 or (206)657-3369 | /__//_//__ // //__/