Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/5/84; site reed.UUCP Path: utzoo!watmath!clyde!cbosgd!ihnp4!alberta!ubc-vision!uw-beaver!tektronix!reed!alexis From: alexis@reed.UUCP (Alexis Dimitriadis) Newsgroups: net.unix,net.unix-wizards Subject: Re: Sv.2 suid bits and shell scripts Message-ID: <2210@reed.UUCP> Date: Fri, 29-Nov-85 04:29:45 EST Article-I.D.: reed.2210 Posted: Fri Nov 29 04:29:45 1985 Date-Received: Sat, 30-Nov-85 06:36:26 EST References: <123@rexago1.UUCP> Reply-To: alexis@reed.UUCP (Alexis Dimitriadis) Distribution: net Organization: Reed College, Portland, Oregon Lines: 37 Xref: watmath net.unix:6440 net.unix-wizards:15906 re `interpreter' is most often "/bin/sh" or "/bin/csh". The _kernel_ regognizes this, and starts the specified interpreter, setting its effective uid if the script is setuid. Use at your own risk. Bonus for 4.2 types: A single argument may follow the `interpreter' name, if it is separated by exactly one space (aaargh..). This makes it possible to write an awk or sed script, say `foo', and run it by typing `foo', without the overhead of exec'ing a shell, like this: #! /bin/awk -f (awk commands here) The kernel tacks the filename at the end, so awk sees /bin/awk -f /u/ss/alexis/bin/foo and everything is peachy. This is a really handy trick that I have not seen used before, so I thought I'd throw it in. Alexis Dimitriadis -- _______________________________________________ Any opinions expressed above have been grown organically and contain no preservatives or artificial sweeteners. alexis @ reed {decvax,ihnp4,ucbcad,uw-beaver}!tektronix!reed.UUCP