Path: utzoo!attcan!uunet!auspex!guy From: guy@auspex.auspex.com (Guy Harris) Newsgroups: comp.unix.wizards Subject: Re: What is a good way to do general execs? Message-ID: <3449@auspex.auspex.com> Date: 11 Jun 90 21:29:01 GMT References: <438@mtndew.UUCP> <347@exodus.Eng.Sun.COM> Organization: Auspex Systems, Santa Clara Lines: 16 >You might also want to adjust this a bit, so the user's .profile >is not read into the shell [speeds up startup]: Nope. You must be assuming that a lot of "#! /bin/sh" headers have "#! /bin/sh -" because the author didn't want ".profile" sourced, presumably along lines similar to "#! /bin/csh -f". That's not what the "-" does; it just makes sure that, if the name of the script begins with "-" (e.g., because somebody's trying to break your set-UID shell script - yes, there are other problems with set-UID shell scripts, but...), the shell does *not* treat it as a flag argument. In that regard, it's similar to the "-b" flag in the C shell. The Bourne shell sources ".profile" *only* for login shells (just as the C shell sources ".login" only for login shells - the "-f" in "#! /bin/csh -bf" is there to prevent it from sourcing your ".cshrc").