mirror of
https://github.com/peklaiho/madlisp.git
synced 2024-11-26 07:04:27 +00:00
remove #! from beginning of loaded files to support use in shell scripts
This commit is contained in:
parent
2b8be79c0e
commit
7e146d8a9d
@ -322,6 +322,11 @@ class Evaller
|
|||||||
|
|
||||||
$input = @file_get_contents($targetFile);
|
$input = @file_get_contents($targetFile);
|
||||||
|
|
||||||
|
// Remove #! from the beginning that is used by shell scripts
|
||||||
|
if (extension_loaded('pcre')) {
|
||||||
|
$input = preg_replace('/^#![^\n\r]*[\n\r]+/', '', $input, 1);
|
||||||
|
}
|
||||||
|
|
||||||
// Wrap input in a do to process multiple expressions
|
// Wrap input in a do to process multiple expressions
|
||||||
$input = "(do $input)";
|
$input = "(do $input)";
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user