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

Have you make your script executable with chmod?
Have you start your script with /directory/scriptname or ./scriptname?

Regards

sorry i couldnt get u :confused:

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

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 . :slight_smile:

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".

You need to copy your scripts file to $HOME/bin

Hi all,

Thanks for ur replies. Actually i have a script already in place. Instead of downloading it and modifying it, i have created a script file in the same name and uploaded it. So that i got this problem. Now got a solution by downloading the old file. then making chang in that and then uploading it. May be i would have had some rights problem before. :slight_smile:
Thank u again for ur kind replies.

Ananthi.U