Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!mit-eddie!ll-xn!ames!aurora!labrea!decwrl!hplabs!hp-pcd!uoregon!omepd!intelisc!littlei!ogcvax!schaefer From: schaefer@ogcvax.UUCP (Barton E. Schaefer) Newsgroups: comp.unix.questions Subject: Re: \"+\" filename -> /bin/sh ! Message-ID: <1466@ogcvax.UUCP> Date: Tue, 20-Oct-87 13:09:14 EDT Article-I.D.: ogcvax.1466 Posted: Tue Oct 20 13:09:14 1987 Date-Received: Sat, 24-Oct-87 16:09:02 EDT References: <9844@brl-adm.ARPA> <3351@sol.ARPA> <6583@brl-smoke.ARPA> Reply-To: schaefer@ogcvax.UUCP (Barton E. Schaefer) Organization: Oregon Graduate Center, Beaverton, OR Lines: 37 In article stuart@cs.rochester.edu (Stuart Friedberg) writes: }In article <6583@brl-smoke.ARPA>, gwyn@brl-smoke.ARPA (Doug Gwyn ) writes: }> In article <3351@sol.ARPA> ken@cs.rochester.edu (Ken Yap) writes: }> > /bin/sh + }> >and get an interactive sh. }> Any Bourne shell that does that is badly broken! } }Ken and I played with this last night. It is *not* that /bin/sh is }broken. "+" is treated by sh the same way as "-", as a flag prefix. }(See the section of the manual on "set".) When, after processing a list }of flags, it finds no arguments left it (by default) starts an }interactive shell. That is, "/bin/sh +" behaves just like "/bin/sh". } } [ Lengthy explanation of what may be happening, including 6 sub-cases, } mercifully deleted :) ] Recall that the original query began with the equivalent of echo date > + ; chmod +x + ; + which for unknown reasons produced an interactive /bin/sh. I tried the 3 "broken" csh-related subcases that Stuart listed, plus a few other combinations, on our VAX 11/780 4.3 BSD. Every one of them produced the date as output, though some took significantly longer to do so than others. The slowest one was "csh +", probably because it was reading my .cshrc file. All this goes to show is that all UN*Xs are not created equal. Stuart and Ken are very probably correct about what is happening on their system, but it doesn't hold true everywhere. My question is, which of these behaviors (those described by Stuart & Ken, or the more "expected" behavior that I found) is "correct"? -- Bart Schaefer CSNET: schaefer@cse.ogc.edu UUCP: ...{tektronix,verdix}!ogcvax!schaefer "It could have been worse. I could have woken up and been Robert Bork." -- Joe Garagiola, after his broadcast partner angered Twins fans