I have had the same problem on some occasions. What caused the problem in my
case was when the scripts were edited by oops I have to say it m$ notepad or
the like. This seemed to put some hidden characters in the text which made
the interpreter real grumpy. Same thing happened to my rc.firewall script.

The solution is to cut and past. Cut/copy the script to the clipboard and
then use favourite editor to past it to a new file and then chmod.

Has worked for me

Mike

-----Original Message-----
From: David Archer [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, 27 February 2002 17:45
To: [EMAIL PROTECTED]
Subject: Downloaded Perl Scripts


I sometimes have a problem running downloaded perl scripts. If I type
something like "perl scriptname.pl" for one of these problem scripts, it
runs fine. When I try "./scriptname.pl" I get the following:

bash: ./scriptname.pl: No such file or directory

the first line does contain "#!/usr/bin/perl" just like my scripts that
run fine. I've run into this before, but never found a solution.
Retyping the script (if it is a short one) usually results in the script
working. This really isn't an option on longer scripts. I also do a
chmod 755 on all the downloaded perl scripts (to cover some of the
obvious questions).  I have tried this as root and as an ordinary user.

When trying to run these problem scripts from apache (with owner and
group set to apache) I get the following in  /var/log/httpd/error_log:

[Tue Feb 26 20:22:17 2002] [error] (2)No such file or directory: exec of
/var/www/cgi-bin/scriptname.pl failed
[Tue Feb 26 20:22:17 2002] [error] [client 24.234.44.166] Premature end
of script headers: /var/www/cgi-bin/scriptname.pl

Any suggestions?

thanks,

David Archer



_______________________________________________
Redhat-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-list


This mail was processed by Mail essentials for Exchange/SMTP, 
the email security & management gateway. Mail essentials adds 
content checking, email encryption, anti spam, anti virus, 
attachment compression, personalised auto responders, archiving 
and more to your Microsoft Exchange Server or SMTP mail server. 
For more information visit http://www.mailessentials.com



_______________________________________________
Redhat-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-list

Reply via email to