[ale] why bash when ksh is default?

Unix Guru Dude geof at denali.is.net
Mon Mar 18 10:06:15 EST 1996


}
}Unix Guru Dude writes:
}
}> [Michael Ivey:]
}
}> }I may be mistaken, but I think that scripts get run by /bin/sh, unless it 
}> }has a shbang.  This is unrelated to your login shell (/etc/passwd), and 
}> }is tied into the way the kernel handles scripts.
}> }
}> }Again, I may be wrong.
}> 
}> I would have expected that the SHELL variable would have been used to
}> run shells.  Apparently this is not the case.  Anyone else concur?
}
}My 1.2.8 kernel fails an exec of a script with no "#!".  That means that
}the shell (or perhaps a library routine) doing the exec is providing a
}backup.  I've seen different ways of doing this in the past -- some shells
}just try to interpret the script themselves.  Others automatically pass
}it to /bin/sh.  For example, the traditional csh behavior if an exec failed
}was to examine the first character of the file; if it was ':', csh itself
}interpreted it, otherwise it was passed to /bin/sh.
}
}The SHELL variable is typically used by programs that want to exec an
}*interactive* shell -- it usually isn't expected to have any relevance
}to an arbitrary shell script.  I'd guess that's the assumption here too.
}
}
}-- Jeff

In all other versions of UNIX I've used, SCO, SunOS, SVR4...  when youe
execute a shell that does not begin with the #!...  It executes using the
shell that the SHELL variable is set to.


-- 
Until later:
Geoffrey Myers   geof at denali.is.net   eiger at ichange.com   gamyers at attmail.com
	http://www.ticllc.net/~geof

	Opinions expressed by me are mine, all mine, only mine.....






More information about the Ale mailing list