Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 684
  • Last Modified:

ksh problem

Hello,

When I execute some ksh scripts on a linux server, this error is returned

-ksh: ./expl.ksh: not found [No such file or directory]

How can I resolve this?

Thanks

bibi
0
bibi92
Asked:
bibi92
1 Solution
 
ozoCommented:
If expl.ksh is not in ./ can you supply the full path?
0
 
farzanjCommented:
Three things:

First as Ozo suggested, check if it is in your current location by doing
ls -l expl.ksh

Second: make sure that file itself is executable
chmod +x expl.ksh

Third: make sure you have shebang in the first line of expl.ksh
#!/bin/ksh
0
 
bibi92Author Commented:
ls -l expl.ksh --> ok -rwxrwxrwx 1 oracle dba 18442 Mar 14 11:01

I have done chmod +x expl.ksh

In the first line of expl.ksh : #!/bin/ksh

But same error when I executed the script.

Thanks

bibi
0
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 
ozoCommented:
is /bin/ksh the correct path?
0
 
simon3270Commented:
Is the file unix format?If it is DOS format, you'd normally get "Bad interpreter" messages, but your shell version might not display that bit.

To check, run"od -c expl.ksh" - the text lines displayed should end with a displayed "\n", not with "\r" followed by "\n".

To convert, the easiest way might be to load it up in vi, enter ":set fileformat=unix", press enter, then save the file with ":wq" and press enter.
0
 
bibi92Author Commented:
Thanks, I have created ln -s /bin/ksh /usr/bin/ksh  for resolve my problem. Regards
0

Featured Post

Become an Android App Developer

Ready to kick start your career in 2018? Learn how to build an Android app in January’s Course of the Month and open the door to new opportunities.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now