Will this be a problem in my script "#! /bin/ksh" ?

All,

In my script i am having the first line as

"#! /bin/ksh"

I see there is a space between #! and /bin ..

My script is working fine and it is not causing any problem.But some time this script is very slow in processing and even some time the script hangs we need to kill and reprocess . When we kill and reprocess it is processing. Is that is the reason becasue of space ????

Thanks in advance,
Arun

No, the problem is unrelated. Probably. Since you did not post your code, I cannot say a lot more. Why? Because if your default shell is Bourne, some ksh-isms may possibly be syntactically correct but may not behave the same in bourne as in ksh.

However, more than likely you have some other performance problems. Or non-terminating loops. etc....

Thanks jim,

THe script is very large and it call another c program and some more scripts . THis scripts is called from another C program

We are calling this as

sh -c "/US/bin/lending_upt 480 566 lend.cfg"

since we are using sh to execute this i thought the space might be the problem

THanks again
Arun

You're running it with the wrong shell: it's a ksh script and you're running it with sh. run it with

ksh -c "/US/bin/lending_upt 480 566 lend.cfg"

When running scripts in this fashion, the #!/bin/ksh line doesn't do anything, it's just treated as a comment.

I am novice at UNIX but I think if is possible you can set up few conditions

Let shell determine if is korn shell available on system if not , then install it , if everything passed well then continue with execution else echo "Please install Korn shell" .

Just an idea :cool:

That line is ignored as a comment in your case as already stated and anyway, this space is never a problem. That's the other way around. Having no space between "#!" and "/bin/interpreter" might be a problem with some old Unix implementations so it is always safer to put one here. In any case, that space can never cause a performance issue.