Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!yale!cmcl2!adm!smoke!gwyn From: gwyn@smoke.BRL.MIL (Doug Gwyn) Newsgroups: comp.unix.admin Subject: Re: help removing a file Message-ID: <13766@smoke.BRL.MIL> Date: 7 Sep 90 16:07:14 GMT References: <1212@tardis.Tymnet.COM> <13419@hydra.gatech.EDU> Organization: U.S. Army Ballistic Research Laboratory, APG, MD. Lines: 23 In article <13419@hydra.gatech.EDU> gt0178a@prism.gatech.EDU (BURNS,JIM) writes: >in article <1212@tardis.Tymnet.COM>, jms@tardis.Tymnet.COM (Joe Smith) says: >> The reason that works is because an executable script that does not start >> with "#", "#!/bin/xxx" or ":" is executed by /bin/sh instead of your default >> shell, >Not on any system I've worked on. It always defaults to $SHELL, your >current shell. If this wasn't true, I couldn't use ksh aliases and >functions inside my scripts w/o #!/bin/ksh (or whatever). If what you mean >is that *csh* defaults to /bin/sh w/o one of your constructs, this is >true. You clearly ought NOT to be able to use ksh-specific features in shell scripts that others might execute from sh or csh, without forcing ksh to be used via #!/.../ksh in the script. $SHELL is a BIG mistake, and I doubt that even ksh is so broken. Much more likely is that it, like sh, forks itself to process anonymous shell scripts. Ksh can do this since it claims to be upward-com-patible with sh, which is what an anonymous scripts should ALWAYS be assumed to have been written for. The 4BSD csh "feature" that assumes that anonymous scripts starting with # (not #!) should be interpreted by the csh rather than sh is simply a design error in the csh that should have been shorted out when installing csh in a more modern environment. Most sh scripts happen to start with #.