The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
shell script to search content of file with timestamps in the directory psychobeauty Shell Programming and Scripting 10 04-21-2008 02:37 AM
Executing Multiple .SQL Files from Single Shell Script file anushilrai Shell Programming and Scripting 3 04-07-2008 07:09 AM
Reading file names from a file and executing the relative file from shell script anushilrai Shell Programming and Scripting 4 03-10-2006 02:25 AM
general question on executing file in drwx--x--x directory cul8erppl Shell Programming and Scripting 2 07-20-2005 01:19 AM
Shell script is not executing dreams5617 UNIX for Advanced & Expert Users 5 08-20-2004 08:45 AM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1  
Old 10-10-2008
Registered User
 

Join Date: Oct 2008
Posts: 3
getting : No such file or directory while executing a shell script

Hi all,

I am getting : No such file or directory while executing a shell script. But i have that corresponding file in the corresponding path. It also have executable rights. Please help me out in this

Thanks in advance.
Ananthi.U
Reply With Quote
Forum Sponsor
  #2  
Old 10-10-2008
Moderator
 

Join Date: Feb 2007
Posts: 2,204
Have you make your script executable with chmod?
Have you start your script with /directory/scriptname or ./scriptname?

Regards
Reply With Quote
  #3  
Old 10-10-2008
Registered User
 

Join Date: Oct 2008
Posts: 3
sorry i couldnt get u
Reply With Quote
  #4  
Old 10-10-2008
Registered User
 

Join Date: Oct 2008
Posts: 9
re: help

well i guess u created a script by using cat or the vi editor ..after that u need to change the permission of the script using chmod 777 filename ..since its a script u need to make it a executable ..after that u could run the script sh filename.sh ...or simply ./filename..both will work ..i guess this was what the previous person was trying to explain
Reply With Quote
  #5  
Old 10-10-2008
Registered User
 

Join Date: Oct 2008
Posts: 9
re:

and he was trying to explain that have u created the script in the correct directory? or are u giving the whole path while running the script.



PS. correct me if i am wrong .
Reply With Quote
  #6  
Old 10-10-2008
Registered User
 

Join Date: Oct 2008
Posts: 7
Also if you donn wan to use it like "./filename" then you need to put your script file in $HOME/bin ... if it exists and included in $PATH, or else create bin in $HOME or anywhere u like and also .. export the same to the $PATH.
eg. export PATH=$PATH:$HOME/bin
then use it as "filename".
Reply With Quote
  #7  
Old 10-10-2008
Registered User
 

Join Date: Oct 2008
Posts: 7
You need to copy your scripts file to $HOME/bin
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 01:54 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0