help removing a file

Doug Gwyn gwyn at smoke.BRL.MIL
Sat Sep 8 02:07:14 AEST 1990


In article <13419 at hydra.gatech.EDU> gt0178a at prism.gatech.EDU (BURNS,JIM) writes:
>in article <1212 at tardis.Tymnet.COM>, jms at 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 #.



More information about the Comp.unix.admin mailing list