From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fdb0e,cdca3dc8d6167cd4 X-Google-Attributes: gidfdb0e,public X-Google-Thread: 1164f8,cdca3dc8d6167cd4 X-Google-Attributes: gid1164f8,public X-Google-Thread: f7344,a808e23c428d1184 X-Google-Attributes: gidf7344,public X-Google-ArrivalTime: 2001-12-30 13:20:42 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news.kjsl.com!news.usenet2.org!citadel.in.taronga.com!not-for-mail From: peter@taronga.com (Peter da Silva) Newsgroups: comp.os.vms,alt.sys.pdp10,comp.sys.dec Subject: Re: historical evidence of what went wrong at DEC Date: 30 Dec 2001 21:14:51 GMT Organization: TSS Inc. Message-ID: References: <3roT7.207043$tf5.13617499@bin5.nnrp.aus1.giganews.com> <00A07421.161CA0C9@SSRL04.SLAC.STANFORD.EDU> <3C2E9074.4EBD2C31@bartek.dontspamme.net> NNTP-Posting-Host: citadel.in.taronga.com X-Trace: citadel.in.taronga.com 1009746891 12247 10.0.0.43 (30 Dec 2001 21:14:51 GMT) X-Complaints-To: usenet@taronga.com NNTP-Posting-Date: 30 Dec 2001 21:14:51 GMT X-Newsreader: trn 4.0-test72 (19 April 1999) Xref: archiver1.google.com comp.os.vms:57428 alt.sys.pdp10:8893 comp.sys.dec:10543 In article , Bill Pechter wrote: >In article <3C2E9074.4EBD2C31@bartek.dontspamme.net>, >>> Yeah, but what's the virtue of being shell-only, when there are multiple >>> shells and you can't guarantee which one you'll be running under. >>That's what the "#!/bin/sh" is for in the beginning of a shell script. >>I can make sure that I have the right shell. >>aak >Which doesn't work in AT&T/USL systems before SVR3 iirc. Yes, on older UNIX systems the shell recognised that a file was a script executed it directly. The shell had code vaguely like this: pid = fork(); if(pid==0) { ...bookkeeping code here... for(each directory in $PATH) { if (isexecutable(directory/program)) { execute(directory/program, program, args...); /* Couldn't execute, assume it's a script */ execute("/bin/sh", "sh", directory/program, args...); bailout("can't exec myself! AUGH"); } } bailout("command not found"); } When there was only one shell this was not an issue. When Berkeley developed the Pascal and C shells they came up with this idea of using a comment character to decide whether to call the V6 shell or the C shell, since the V6 shell only used ":" for comments (actually, these were labels) and the C shell used "#". Later, they came up with the idea of adding the magic number 020443 (#! in ASCII) to the kernel's list of executable file formats... this would of course read the command interpreter from the first line of the file. This didn't show up in AT&T UNIX until they did their big "leeching session" to add BSD interfaces to either SVR3.0 or SVR3.2. >At least my old SysIII and SVR2 based systems used : at the top of >/bin/sh and # for csh and didn't support #!shellname. >Ah yes 4.2 is > V. I wish I had that poster. I do have the "4.4 > 5.4" one. -- Rev. Peter da Silva, ULC. "Cave cuniculos lagana ferentes" "Be conservative in what you generate, and liberal in what you accept" -- Matthew 10:16 (l.trans)