Korn Shell Not Found Error
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn ksh command not found unix more about hiring developers or posting ads with us Unix & Linux Questions Tags Users
Shell Script No Such File Or Directory Error
Badges Unanswered Ask Question _ Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other
/bin/ksh Not Found
Un*x-like operating systems. Join them; it only takes a minute: Sign up Here's how it works: Anybody can ask a question Anybody can answer The best answers are voted up and rise to the top -ksh: revenue_ext.ksh: not found
How To Run Ksh Script In Unix
[No such file or directory] up vote 3 down vote favorite 1 I am getting the same not found [No such file or directory] error when trying to execute a ksh script. Read tips about the PATH and running the script with a ./ in the posts here and here and tried but no luck. The script does exist under the directory from where I am trying to execute and has full permissions but gives the same error ksh cannot open when run directly or with a ./. The first line within the script also has #!/usr/bin/ksh The error message is like below: -ksh: revenue_ext.ksh: not found [No such file or directory] However, other ksh scripts under the same directory run fine so am absolutely clueless about what could be wrong here. Any help would be greatly appreciated shell-script ksh executable share|improve this question edited Jun 5 '14 at 23:10 Gilles 372k696761127 asked Jun 5 '14 at 3:51 user68112 23125 What is the output of cat -v revenue_ext.ksh? –Ramesh Jun 5 '14 at 4:00 If you have moved this file from windows to unix Then run dos2unix filename filename command –sonal May 31 at 8:18 add a comment| 1 Answer 1 active oldest votes up vote 3 down vote accepted I believe there may be some carriage returns causing this error here. I was able to reproduce the error successfully. Testing cat ksh_experiment.ksh #!/usr/bin/ksh echo "Hello" Now after providing the permissions when I ran the file, it produced the output successfully. Now as discussed over here, I inserted some carriage returns in my file. Now when I ran the script, I was getting the output as, ksh: ./ksh_experiment.ksh: not found [No such file or directory] Now, cat -v ksh_experiment.ksh too produced the same output. Also, if I typed vim ksh_experiment.ksh , a new file was getting opened.
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn ksh cannot execute more about Stack Overflow the company Business Learn more about hiring developers or posting ksh not found in linux ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community no such file or directory linux shell script Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up not found [No such file or directory] error, even though http://unix.stackexchange.com/questions/134581/ksh-revenue-ext-ksh-not-found-no-such-file-or-directory the file present in that directory on RH Linux 6.2 up vote 6 down vote favorite 2 When I’m executing a script from Linux (RH Linux 6.2), it is giving not found [No such file or directory] error, even though the file is present in that directory (checked the permissions and they are fine). Example: md1silinux04:/data/upgrade> /data/upgrade/upgrade_db.ksh -ksh: /data/upgrade/upgrade_db.ksh: not found [No such file or directory] md1silinux04:/data/RAIL/rpo402/db/upgrade> ls /data/upgrade/upgrade_db.ksh http://stackoverflow.com/questions/18125667/not-found-no-such-file-or-directory-error-even-though-the-file-present-in-tha /data/upgrade/upgrade_db.ksh Could anybody please help on this ? linux shell share|improve this question edited Dec 9 '13 at 22:27 javaPlease42 1,1981234 asked Aug 8 '13 at 12:09 Naga 4027 1 Update it with this output: ls -ls /data/RAIL/rpo402/db/upgrade –Edward Aug 8 '13 at 12:11 can you paste the permissions (ls -l /data/RAIL/rpo402/db/upgrade)? are you sure the file has execute permission (chmod +x)? –mnme Aug 8 '13 at 12:12 @mnme -rwxrwxr-x. –Naga Aug 8 '13 at 12:13 What is the size of the file? Make sure it isn't empty. Also, what is the first line of the file? –Edward Aug 8 '13 at 12:15 I really hope you're not using Red Hat Linux 6.2. You mean Red Hat Enterprise Linux 6.2, surely? –Robin Green Nov 7 '13 at 21:18 add a comment| 2 Answers 2 active oldest votes up vote 4 down vote Perhaps you have ctrl-M (carriage returns) at the end of each line in your file. To View: cat -v /data/upgrade/upgrade_db.ksh To Fix: perl -p -i -e "s/\r//g" /data/upgrade/upgrade_db.ksh share|improve this answer answered Nov 7 '13 at 21:12 user2966631 412 add a comment| up vote 0 down vote Enter this: ls -ls /da
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn http://stackoverflow.com/questions/20072417/aix-ksh-file-not-found-error more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up AIX KSH file not found error up vote 0 not found down vote favorite I have placed the .ksh file in a path. And, I have tried to run that file. But it is showing error like ksh: db2replicator.xxxx.yyy.capture.start.cold.ksh: not found Please help me to find the solution. shell aix share|improve this question edited Nov 19 '13 at 13:34 fedorqui 110k30167217 asked Nov 19 '13 at 13:08 Ananth Francis 3117 This means that the file db2replicator.xxxx.yyy.capture.start.cold.ksh does no such file not exist. –devnull Nov 19 '13 at 13:10 What exactly did you place in the path of your .ksh? –Mithrandir Nov 19 '13 at 13:11 add a comment| 1 Answer 1 active oldest votes up vote 1 down vote The first row of your script must contain a valid shell. I could reproduce your error message with the following: > cat db2replicator.xxxx.yyy.capture.start.cold.ksh #!/bin/iDONTexist date > ./db2replicator.xxxx.yyy.capture.start.cold.ksh ksh: ./db2replicator.xxxx.yyy.capture.start.cold.ksh: not found. A correct first line reads: #!/bin/ksh share|improve this answer answered Jan 16 '14 at 10:56 AIXroot 465 add a comment| Your Answer draft saved draft discarded Sign up or log in Sign up using Google Sign up using Facebook Sign up using Email and Password Post as a guest Name Email Post as a guest Name Email discard By posting your answer, you agree to the privacy policy and terms of service. Not the answer you're looking for? Browse other questions tagged shell aix or ask your own question. asked 2 years ago viewed 2063 times active 2 years ago Related 788How to mkdir only if a dir does not already exist?0opening a file in aix0Running JAR file on AIX via KornShell script1Cant find .gz file in AIX1AIX