I can't execute my KornShell (ksh) script without the ksh command. I included #!/bin/ksh in the first line of the script but when I try to execute it by name only, it says no such file or directory. Can someone help me?
make sure that ksh is correctly installed in /bin/ksh
try which ksh from the command-line.
consider #! /usr/bin/env ksh for more portability.
for executing a script run from the command-line ./script in the directory where script exist.
If you want to execut the script from any directory without ./ prefix, you have to add the path to your script to the PATH environment variable, add this line
export PATH="path_to_your_script":$PATH
to you ~/.kshrc file.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With