script not executable

script not executable

Post by arab » Fri, 15 Feb 2002 19:28:10



I have a little perl script that I can't execute properly. The problem
is making it executable, not the script itself.

Here is what I am doing: the script is sitting in a directory 'bin' in
my home directory. It's executable, and my PATH is set to include
/home/uuser/bin:

m2:~$ cd
m2:~$
m2:~$ ls -l | grep bin
drwxr-xr-x   2 uuser sndusrs    4096 Feb 14 02:09 bin
m2:~$
m2:~$ ls -l bin
total 16
-rwxr--r--   1 uuser sndusrs    5387 Feb 14 02:08 rgrep.pl
m2:~$ echo $PATH
/usr/local/bin/  <snip>  /home/uuser/bin

But when I try to execute it, I get:

m2:~$ rgrep.pl
bash: /home/uuser/bin/rgrep.pl: No such file or directory

What am I doing wrong?

Thanks!

 
 
 

script not executable

Post by John Howell » Fri, 15 Feb 2002 19:35:41



> I have a little perl script that I can't execute properly. The problem
> is making it executable, not the script itself.

> Here is what I am doing: the script is sitting in a directory 'bin' in
> my home directory. It's executable, and my PATH is set to include
> /home/uuser/bin:

> m2:~$ cd
> m2:~$
> m2:~$ ls -l | grep bin
> drwxr-xr-x   2 uuser sndusrs    4096 Feb 14 02:09 bin
> m2:~$
> m2:~$ ls -l bin
> total 16
> -rwxr--r--   1 uuser sndusrs    5387 Feb 14 02:08 rgrep.pl
> m2:~$ echo $PATH
> /usr/local/bin/  <snip>  /home/uuser/bin

> But when I try to execute it, I get:

> m2:~$ rgrep.pl
> bash: /home/uuser/bin/rgrep.pl: No such file or directory

> What am I doing wrong?

That misleading error message usually indicates that the first line of
the file is of the form:

        #! <prog>

but <prog> is either invalid or not executable. Does it match the
precise location of your perl?

John Howells

 
 
 

script not executable

Post by Casper H.S. Di » Fri, 15 Feb 2002 20:12:18



>But when I try to execute it, I get:
>m2:~$ rgrep.pl
>bash: /home/uuser/bin/rgrep.pl: No such file or directory

That typically happens with scripts that start with:

        #!/bin/prel
    or
        #!/no/such/file

Casper
--
Expressed in this posting are my opinions.  They are in no way related
to opinions held by my employer, Sun Microsystems.
Statements on Sun products included here are not gospel and may
be fiction rather than truth.

 
 
 

script not executable

Post by Kenneth C Stah » Fri, 15 Feb 2002 20:50:22



> I have a little perl script that I can't execute properly. The problem
> is making it executable, not the script itself.

> Here is what I am doing: the script is sitting in a directory 'bin' in
> my home directory. It's executable, and my PATH is set to include
> /home/uuser/bin:

> m2:~$ cd
> m2:~$
> m2:~$ ls -l | grep bin
> drwxr-xr-x   2 uuser sndusrs    4096 Feb 14 02:09 bin
> m2:~$
> m2:~$ ls -l bin
> total 16
> -rwxr--r--   1 uuser sndusrs    5387 Feb 14 02:08 rgrep.pl
> m2:~$ echo $PATH
> /usr/local/bin/  <snip>  /home/uuser/bin

> But when I try to execute it, I get:

> m2:~$ rgrep.pl
> bash: /home/uuser/bin/rgrep.pl: No such file or directory

> What am I doing wrong?

> Thanks!

It could be that your CWD is not in your path. Try using the form:

./myprog.pl

 
 
 

script not executable

Post by Mathias Waac » Fri, 15 Feb 2002 22:09:12




>>But when I try to execute it, I get:

>>m2:~$ rgrep.pl
>>bash: /home/uuser/bin/rgrep.pl: No such file or directory

> That typically happens with scripts that start with:

> #!/bin/prel
>     or
> #!/no/such/file

Advanced users use scripts copied from a Windows machine without removing
the leading linefeeds. This is harder to figure out and thus produces much
more fun.

Mathias

 
 
 

script not executable

Post by Andre » Fri, 15 Feb 2002 22:35:28


The script can only be executed by user  uuser, are you that user ??

Regards

Quote:> I have a little perl script that I can't execute properly. The problem
> is making it executable, not the script itself.

> Here is what I am doing: the script is sitting in a directory 'bin' in
> my home directory. It's executable, and my PATH is set to include
> /home/uuser/bin:

> m2:~$ cd
> m2:~$
> m2:~$ ls -l | grep bin
> drwxr-xr-x   2 uuser sndusrs    4096 Feb 14 02:09 bin
> m2:~$
> m2:~$ ls -l bin
> total 16
> -rwxr--r--   1 uuser sndusrs    5387 Feb 14 02:08 rgrep.pl
> m2:~$ echo $PATH
> /usr/local/bin/  <snip>  /home/uuser/bin

> But when I try to execute it, I get:

> m2:~$ rgrep.pl
> bash: /home/uuser/bin/rgrep.pl: No such file or directory

> What am I doing wrong?

> Thanks!

 
 
 

script not executable

Post by NorwoodThr » Sat, 16 Feb 2002 02:45:29


Try:

./rgrep.pl

 
 
 

script not executable

Post by Barry Margoli » Sat, 16 Feb 2002 05:08:38





>> I have a little perl script that I can't execute properly. The problem
>> is making it executable, not the script itself.

>> Here is what I am doing: the script is sitting in a directory 'bin' in
>> my home directory. It's executable, and my PATH is set to include
>> /home/uuser/bin:

>> m2:~$ cd
>> m2:~$
>> m2:~$ ls -l | grep bin
>> drwxr-xr-x   2 uuser sndusrs    4096 Feb 14 02:09 bin
>> m2:~$
>> m2:~$ ls -l bin
>> total 16
>> -rwxr--r--   1 uuser sndusrs    5387 Feb 14 02:08 rgrep.pl
>> m2:~$ echo $PATH
>> /usr/local/bin/  <snip>  /home/uuser/bin

>> But when I try to execute it, I get:

>> m2:~$ rgrep.pl
>> bash: /home/uuser/bin/rgrep.pl: No such file or directory

>> What am I doing wrong?

>> Thanks!

>It could be that your CWD is not in your path. Try using the form:

>./myprog.pl

Since the script isn't in his CWD, it's in his bin directory (which he
showed is in his PATH), that can't possibly work!

--

Genuity, Woburn, MA
*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
Please DON'T copy followups to me -- I'll assume it wasn't posted to the group.

 
 
 

1. PPP script not executable

In order to estabilish a ppp connection with my isp in linux (redhat 5.2), i
was told to write some scripts. One for dialing (ppp-on), and one for
terminating the connection (ppp-off). I wrote and saved them in the correct
location. The problem is the scripts executing, I was told to use 'chmod 755
ppp-on/off' to make them executable. After putting the line in, i got no
error messages or anything else, the prompt just appeared again, one line
below. When I typed ppp-on/off, i got the 'bash: ppp-on/off: command not
found' or similar. I tried chmod 700, but it still won't become an
executable. Or it is, but you must have to type something else. Is this
true? Like 'exec ppp-on/off' or something?
Thanks.

2. symbios 810 card

3. Executable Binary File vs. Executable Script File

4. ”Looking for dealers.

5. Executable is not executable

6. FAQ for lex + yacc? (was Re: using lex with strings, not files)

7. Make sh script executable but not copyable?

8. Need Help: XFree 3.1 setup - monitor section?!?

9. self decrypting shell scripts (executable / not reable)

10. BASH script executable but not readable?

11. Script or executable to format bash scripts

12. /usr/sbin/pppd does not exist or is not executable

13. gdb: core file not in executable format: File format not recognized