Is perl actually located at /usr/bin/ on your machine?
If you try to call a perl script directly, without using the perl command you will get an error:
I've checked and perl is located in /usr/bin/perl, but #!/usr/bin/perl in the script doesn't work.Code:bt ~# cdmod 777 myscript.pl bt ~# ./myscript.pl -bash: ./myscript.pl: /usr/bin/perl^M: bad interpreter: No such file or directory.
But when I use the perl command everything works fine:
Code:perl myscript.pl
Is perl actually located at /usr/bin/ on your machine?
A third party security audit is the IT equivalent of a colonoscopy. It's long, intrusive, very uncomfortable, and when it's done, you'll have seen things you really didn't want to see, and you'll never forget that you've had one.
I'm by no means a bash expert, but your error returned:
What's with the ^M and are you sure that this isn't causing a problem within the script itself?Code:bash: ./myscript.pl: /usr/bin/perl^M: bad interpreter: No such file or directory.
"\x74\x68\x65\x70\x72\x65\x7a\x39\x38";
That is the question, where is this ^M coming from?!
The script works just fine when I call it with perl myscript.pl.
Ok... This is really weird...
I've created a new .pl file and rewrote the code... and now it works.
The only thing I can think about that this file was created under windows.
This is really weird, I mean it worked just fine with SuSE.
There's your problem fishbulb. If you edited the file in Windows, the carriage return is screwed up in Linux. It's strange, but I've seen it many times before, and was just going to post that when Prez pointed out the ^M.
I've gotten a few scripts for a box that I run here where people have edited the files in windows and it works for them on their box, but on mine (CentOS) it doesn't until I go through in vi or nano and remove all the ^M's.
A third party security audit is the IT equivalent of a colonoscopy. It's long, intrusive, very uncomfortable, and when it's done, you'll have seen things you really didn't want to see, and you'll never forget that you've had one.
I've tried to rewrite this line with nano and vi, but I still get this ^M.
But why some distributions work and others don't? Wierd like hell.
A quick google search revealed these, among other possible solutions:
http://www.linuxquestions.org/questi...ectory-461400/
http://www.linuxforums.org/forum/red...directory.html
[FONT=Courier New][SIZE=2][FONT=Courier New]hehe...
[/FONT][/SIZE][/FONT]