There are a couple of possibilities here.
1 -- The 'shebang line' ("#! /user ...") may have a leading space. The Shell, not finding '#!' as the first two characters takes off an tries to parse/run the "ksh" script it has just discovered.
2 -- The first line in the file is empty, so the Shell having no other guidance takes off and fails during the parse.
----
I Go Back to Sleep, Now.
OGB
| [reply] |
The handling of #! as the first two bytes of the
file is a kernel issue. It's the kernel that looks
at the first couple of bytes of an executable, and then
decides how to run it. When issued properly, no shell will
be involved. In fact, if the program gets fed to the shell,
the first line will be ignored. # is, afterall, the
start of a comment.
Abigail
| [reply] |
A third (unlikely) possibility is that Eudoro is executing the script on the commandline as follows
$ ksh my_script.pl
As I said, unlikely, but possible.
------
We are the carpenters and bricklayers of the Information Age.
Please remember that I'm crufty and crochety. All opinions are purely mine and all code is untested, unless otherwise specified.
| [reply] [d/l] |
Placing a she-bang line is only half the trick - the kernel
must also sniff at it. How are you calling your program, and
what are its execution bits?
Abigail | [reply] |
I am executing it using:
. ./test.pl
| [reply] |
Well, that's wrong. You are telling your current shell
to execute the program in the current shell (without a fork).
Remove the first dot.
Abigail
| [reply] |