Please help on shell scripts execution


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Please help on shell scripts execution
# 1  
Old 09-18-2006
Please help on shell scripts execution

I have already posted the question. Because previous post has sinked so that I have to ask the question again. I created the script and chmod it as 755. The ksh shell is in bin. Now I typed ./script_name.ksh to execute the script in the directory of that script. The return message was: Ksh: ./script_name.ksh: Not found. What does this mean? I typed script name correctly. I am really confused by this. Anyone could give ma a hand? Thanks a lot.

Also, another question for execution permission: if a folder's permission show like: drwxr-sr-x, what is group's r-s, The user's rwx=7, other's r-x=5, I couldn't find what is group's r-s. Please advise. Thanks again.

Last edited by duke0001; 09-18-2006 at 01:40 PM..
# 2  
Old 09-18-2006
Try with the the following in line 1 of your script :
Code:
#! /bin/ksh

Jean-Pierre.
# 3  
Old 09-18-2006
Yes, #! /bin/ksh is on the top of the script.
# 4  
Old 09-19-2006
Have you looked to see if there are hidden characters in your script name?
You could check by doing somthing like

#ls | cat -v

If you see odd stuff in your name then that could be why?
# 5  
Old 09-19-2006
Make absolutely sure that the /bin/ksh or the /usr/bin/ksh file exists and that you are referring to the correct file in your script. This error is what is encountered when the interpreter is not found.

As for your question about the directory permissions, please go through the tutorials. Perderabo has written an excellent tutorial on file permissions.
# 6  
Old 09-19-2006
Andrek and blowtorch:

Thanks so much for your advice. I followed to check script name and ksh files in /bin/ksh and in /usr/bin/ksh. ksh files exist in these directories and script name has no hidden characters. Then I tried to kick it off. It still told me 'Not found'. Why do I check ksh files existing? Do I need to register my script in these ksh files or something else? I am confused by this. Any idea?
# 7  
Old 09-19-2006
Remove line 1 (#! ..) and execute your script like that :
Code:
ksh ./script_name.ksh

Jean-Pierre.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

How to check sub scripts execution?

I have a shell script which is used to get the input and have another shell script (a sub script) at the end of this shell script which is used to upload the inputs in the Oracle database. I can check the execution status of the parent script using sh -x script.sh. but this command doesn't show the... (1 Reply)
Discussion started by: srilaxman
1 Replies

2. UNIX for Dummies Questions & Answers

Execution problem in running multiple scripts

hi all, I have 3 individual scripts to perform the task . 2nd script should run only after the 1st script and 3rd script must run only after first 2 scripts are executed successfully. i want to have a single script that calls all this 3 scripts .this single script should execute the 2nd script... (1 Reply)
Discussion started by: Rahul619
1 Replies

3. Shell Programming and Scripting

Shell execution

hi, Pls bare with me if this is trivial. Is it possible to run a korn shell with out specifying the name with its extensiion? Do i need to make any changes to the script make it work? Thanks (3 Replies)
Discussion started by: dvah
3 Replies

4. Shell Programming and Scripting

Execution difference in perl scripts for windows / AIX

Hi, I have perl script abc.pl which runs perfectly fine on windows ( execution from cmd). Now i tried to execute the same perl module on the AIX server after defining the captureoutput.pm and other relevant changes. But its behaving very weirdly as a portion of the URL which is formed by... (3 Replies)
Discussion started by: slayer0611
3 Replies

5. Shell Programming and Scripting

calling 'n' number of shell scripts based on dependency in one shell script.

Hello gurus, I have three korn shell script 3.1, 3.2, 3.3. I would like to call three shell script in one shell script. i m looking for something like this call 3.1; If 3.1 = "complete" then call 3.2; if 3.2 = ''COMPlete" then call 3.3; else exit The... (1 Reply)
Discussion started by: shashi369
1 Replies

6. Shell Programming and Scripting

Questions on shell execution

Hi, I have a question regarding Korn shell script execution in HP-UX 11.11. What sort of environmental settings do I need to run a Korn shell script such as below without entering "./" at the begining of the command? cat test.ksh date I am able to do this with a user called infodba who... (6 Replies)
Discussion started by: stevefox
6 Replies

7. Shell Programming and Scripting

Scripts fails if you change its code during the execution.

So a script is working properly (tested many times) , then you add a new fine piece of code ,finaly its fails generally with a syntax error at the last line of the script. :confused:... does anybody why this happens? >uname -a HP-UX test... (4 Replies)
Discussion started by: Klashxx
4 Replies

8. UNIX for Dummies Questions & Answers

Scripts execution

hello everybody: i think this is really quite of dummy question. after I write a new script, and give it the execute permission. some times its just enough to call its name to run the script , other times I need to include ksh or ./ScriptName . so how I can make all my scripts run by just... (9 Replies)
Discussion started by: aladdin
9 Replies

9. AIX

Difference between writing Unix Shell script and AIX Shell Scripts

Hi, Please give me the detailed Differences between writing Unix Shell script and AIX Shell Scripts. Thanks in advance..... (0 Replies)
Discussion started by: haroonec
0 Replies

10. Shell Programming and Scripting

execution of shell script

How can I execute another shell script from one? Malay (5 Replies)
Discussion started by: malaymaru
5 Replies
Login or Register to Ask a Question