Path: utzoo!utgpu!watmath!att!ucbvax!hplabs!hp-pcd!hpcvca!charles From: charles@hpcvca.CV.HP.COM (Charles Brown) Newsgroups: comp.sys.amiga.tech Subject: Re: Dealing with multiple scripting languages (was: Elinating the 'rx' from AREXX) Message-ID: <1410024@hpcvca.CV.HP.COM> Date: 16 Aug 89 18:36:30 GMT References: <1989Aug14.015608.21854@agate.berkeley.edu> Organization: Hewlett-Packard Co., Corvallis, Oregon Lines: 31 >> FALSE. If the magic number does not match, and there is no #! >> interpreter specified, the exec call assumes /bin/sh as an >> interpreter. The syntax errors you get are bourne shell errors, from >> the shell execve() created, NOT your current shell. >> For example, if you have a csh shell script, and are using csh, >> executing the csh script will try to interpret it with sh unless you >> begin the file with "#!/bin/csh". Only typing "source" will >> make the current shell execute the commands. > NOT TRUE :-) > If you have a csh script and you are using the csh, a comment as the > first line will give you a csh interpretation. If you do not have a > comment as the first line you will invoke /bin/sh to execute the script, > which of course will fail since the script was a csh script (unless it > is echo hello :-) > UUCP: ...!gatech!uflorida!sun.ufnet.ufl.edu!misterx Devine was correct, at least for some Unices. Under HP-UX, #!/bin/csh is interpreted by exec before csh OR sh sees it. The convention you describe (comment first -> /bin/csh, else /bin/sh) is older and is obsolete. I don't know if HP-UX inherited this behaviour from AT&T or from BSD. (HP-UX tries to take the best of both.) Anyway this would be a good convention for the Amiga to adopt. (If the first line is #!prog, then use prog to interpret the file.) -- Charles Brown charles@cv.hp.com or charles%hpcvca@hplabs.hp.com or hplabs!hpcvca!charles or "Hey you!" Not representing my employer. "The guy sure looks like plant food to me." Little Shop of Horrors