The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 07-02-2009
Browser_ice Browser_ice is offline
Registered User
  
 

Join Date: Nov 2005
Location: Canada
Posts: 110
Unhappy /bin/ksh: scriptname: not found. ???

I have started to write Korn scripts on the client's AIX 4.2 servers and there is this small problem that puzzles me.

I code all my scripts the same way:
- first line contains :
#!/bin/ksh

- I do this console command on every scripts:
chmod +x scriptname

But still, on some occasions, when running a script (ex: called scriptname.sh), I get an error that I do not understand:
/bin/ksh: scriptname.sh: not found.

It does not always happen but when it happens, its when I am trying to run a new script for the first time. Once it starts to happen, the only way to run that script is to :
ksh scriptname.sh

If a script never had this from the start, it will never happen to it. When logging in with my user-id, the first thing I do is sudo su -


Why is this happening ?
Am I forgetting to do something ?
I do not recall if it is happening on specific servers or not.