Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sh script.

Status
Not open for further replies.

InduPramod

IS-IT--Management
Apr 17, 2001
53
0
0
ZA
I have AIX 4.3.3. I have got a shell script. When I try to execute ./filename.sh it comes with error filename.sh not found. Do I have to specify somewhere else or what can be the cause of it.Can someone help me.
 
Hi Indu

If you not in the current directory where the script is then you will not be able to execute it unless you specify the path or add the the path to /etc/environment.check that the permissions are correct and that its executable.
chmod 777 filename .

good luck !!
 
Hi Rishard,

I am on the current directory and I have changed the file permission to 777. But no success. It comes with error

Ksh: ./filename.sh not found.

Is there anything else to be checked
 
Have you tried just running filename.sh (ie without the ./)?

Alternatively, I have seen this strange behaviour where a shell script has been copied from a DOS environment. I fixed it using the dos2unix utility in Solaris - I'm not sure what the equivalent is in AIX. You can also srip out any ^M characters in vi.

Good luck.
 
I have got the solution. The problem was the file was a binary file and while ftp it I didn't convert it.Thats why.

Thanks for all the help
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top