I have a very mysterious problem with bash and/or perl. I'll try to describe the behaviour.
Running a perl script via
./perlscript.pl
gives me a permission denied message.
(I am the owner of the file and the path to it -from my home dir and the file contains #!/usr/bin/perl and is executable -rwxr-xr-x )
Running the script like this:
perl perlscript.pl
is ok...
Can anyone please help me fix my bash? Thank you
$ which perl
/usr/bin/perl
$ head -1 file.pl | od -c
0000000 # ! / u s r / b i n / p e r l \n
0000020
!#/usr/bin/perlor was that a typo? The correct directive is#!/usr/bin/perlor better#!/usr/bin/env perl.which perlreturn ?\r\nbecause grep is a line oriented tool (grep will not ever find\n). Try:head -1 file.pl | od -c