> > $ thisfile
> > -ksh: thisfile: cannot execute [Permission denied]
On Thu, 29 Jul 1999, Andy Goth wrote:
> So I was right. I was expecting pdksh, though (the Public Domain Korn
> SHell).
It appears that the maillist switched the order of my two posts. Yes, Korn
Shell. In my experience pdksh is not a good substitute for ksh (although
my experience was years ago; not sure of the current status).
> And what of the C Shell?
I have used the C Shell, and it provides a nice interface. However, csh is
worse than worthless for creating scripts:
<quote>
Unix Support frequently advises people not to use /bin/csh. Here is the
classic document by Tom Christiansen on why you shouldn't use it for
scripts.
Csh Programming Considered Harmful
Resolved: The csh is a tool utterly inadequate for programming, and its
use for such purposes should be strictly banned.
I am continually shocked and dismayed to see people write test cases,
install scripts, and other random hackery using the csh.
</quote>
See the complete article at:
http://vega.ing.iac.es/~cfg/notes/pub_notes/csh.html
> ...I read about one version called "tcsh" in a
> Linux book.
I've heard it is improved. I'd do some research before I started using it,
however. The above URL is a good place to start, it mentions tcsh.
> Isn't there a convention that the first line of all shell scripts should
> be a comment identifying which shell it is to be run with? I believe I
> have seen things like:
>
> #!/bin/sh
In the UNIX world, there are basically two types of shell scripts-- those
based upon the Bourne Shell (including Korn Shell and BASH), and those
based upon the C Shell. The common shell language for writing portable
scripts is the Bourne Shell. Advanced features of other shells are to be
avoided unless the script is never expected to leave the target system.
There may be other considerations for Linux. It seems that BASH has become
pretty much a standard.
The #! convention is an interesting story. Too long for posting here; I
refer you to:
unix/faq Digest part 3 of 7 by Ted Timar - [EMAIL PROTECTED]
It is a regular posting in comp.unix.shell, or check out:
http://www.faqs.org/faqs/by-newsgroup/comp/comp.unix.shell.html
Here is just an excerpt:
<quote>
3.16) Why do some scripts start with #! ... ?
[...]
The Berkeley folks had a neat idea to extend how the kernel starts
up programs. They hacked the kernel to recognize the magic number
`#!'. (Magic numbers are 16-bits and two 8-bit characters makes
16 bits, right?) When the `#!' magic number was recognized, the
kernel would read in the rest of the line and treat it as a
command to run upon the contents of the file. With this hack you
could now do things like:
#! /bin/sh
#! /bin/csh
#! /bin/awk -F:
This hack has existed solely in the Berkeley world, and has
migrated to USG kernels as part of System V Release 4.
[...]
</quote>
best wishes,
richard myers