Why cant i execute a perl script
When I try to execte my script I get following error:
[root@ scripts]# su cactiuser perl unix_apachestats.pl localhost perl: /usr/bin/perl: cannot execute binary file I also tried [root@ scripts]# su cactiuser unix_apachestats.pl localhost unix_apachestats.pl: /bin/bash=/bin/bash: No such file or directory unix_apachestats.pl: =/usr/bin/lynx: No such file or directory unix_apachestats.pl: =/usr/bin/head: No such file or directory unix_apachestats.pl: my: command not found unix_apachestats.pl: chomp: command not found unix_apachestats.pl: line 34: syntax error near unexpected token `{' unix_apachestats.pl: line 34: `if ($hostname eq '') {' |
In order to narrow the possible sources for this error, it might be a good idea to check the system log file, to see if there is a more detailed error message.
In a Debian system this file is located at /var/log/messages Shortly after reproducing the error, display the newest lines in this usually very long file by typing: Code:
tail /var/log/messages |
try su - cactiuser perl unix_apachestats.pl localhost
su by itself does not set environment variables needed by this script. call it with su - (the minus runs the environment scripts and sets the variables).. |
All times are GMT -5. The time now is 08:59 AM. |