No such file or directory

Posted on 2001-09-08
Last Modified: 2010-04-22
I just created a .cgi file and tried to run it from the command line.  I get the error
No such file or directory.

Permissions are set to 745.  The file is there. I have another cgi file in the same directory that executes from the command line.

Any ideas what's going on?
Question by:castello
  • 2
  • 2

Expert Comment

ID: 6468142
please post an ls -l yourfile  and a ls -l of the other file
that is in the same directory and executes.

Author Comment

ID: 6468275
the file that won't run:
-rwxr--r-x     1 me     me          1085 Sep 8 23:10 print.cgi

the file that will run:
-rwxr--r-x     1 me     me          1104 Sep 7 10:57 vewpaghit.cgi  

Expert Comment

ID: 6468649
Very strange

     I would advise you to to the following:
 -  Recreate print.cgi
 -  chmod it 777
 -  If you have Korn Shell,  try to run it :
        ksh -x print.cgi

 - If "No such file or directory" still appears, check
   if the script internally is trying to access a file
   or directory that does no exist.
LVL 51

Accepted Solution

ahoffmann earned 100 total points
ID: 6468887
you specified a wrong interpreter in the very first line of the script (following the #!).

Author Comment

ID: 6470422
I forgot the / after #!

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In tuning file systems on the Solaris Operating System, changing some parameters of a file system usually destroys the data on it. For instance, changing the cache segment block size in the volume of a T3 requires that you delete the existing volu…
I have been running these systems for a few years now and I am just very happy with them.   I just wanted to share the manual that I have created for upgrades and other things.  Oooh yes! FreeBSD makes me happy (as a server), no maintenance and I al…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.

813 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now