Why does perl execute bash scripts?
I'm playing with perl and found that I could just go:
"perl /home/me/bash_script.sh" and it would execute, even though it's not a perl script. Is that just a feature or is there something I'm missing? Why does perl do this? |
if the script has a shebang (#!/bin/bash) at the beginning it may hand it over to bash to execute. try this on a bash script without a shebang. Im not sure if this is the case, just a thought.
|
Hi zensunni,
afaik, the Perl interpreter will read the Shebang at the beginning and pass the script off to bash. Without this line, the Perl interpreter will try to execute the script itself. |
You can read about it here:
http://perldoc.perl.org/perlrun.html And this part may be of interest: Quote:
|
All times are GMT -5. The time now is 10:33 PM. |