Script not working with ksh

Hi

I am not able to execute a script with ksh. Its not giving any error too.
I have tried with absolute path

/usr/bin/ksh test.sh

.
Also checked path variable and all looks fine

It runs fine with sh.

OS is solaris 10.

Can you provide more details about what the test.sh script is expected to do ?

the problem is not related to a single script.

even if I run a script with echo hello , it doesnt not work with ksh.

So what says:

/usr/bin/ksh -xc "echo hello"

?

/usr/bin/ksh -xc "echo hello"

+ echo hello
hello

---------- Post updated at 01:13 AM ---------- Previous update was at 01:10 AM ----------

But still

$

/usr/bin/ksh test

(see here no error , it just returns to the prompt)

$

sh test

(the same works in sh)
hello

ksh test

is executing the ksh test built-in (which when given no operands produces no output but produces a non-zero exit status). Either rename you shell script to something other than test , or try executing it with:

ksh ./test

to invoke your script instead of the built-in with the same name.

You script is supposed to be named test.sh, not test.

ksh ./test is working.

Looks like problem is path variable as i did PATH=. and ran ksh test , it worked .

As Don Cragun already stated, don't name a script of yours the name of a shell builtin.

Yeah noted on the name, but still have the problem with our own custom scripts with unique names. Working on problem with PATH variable