Let's take this command, for example:
$command = "echo '/just/for/the/test /heh/' | awk '//just// {print $1}'";
When directly copying inside the shell, I get the following error:
awk: cmd. line:1: //just// {print $1} awk: cmd. line:1: ^ unterminated regexp
But, when I exec() it, I get status code 1 without output:
exec($command, $output, $status); var_dump( $command, $output, $status ); // string(69) "echo '/just/for/the/test /heh/' | awk '//just// {print $1}'" // array(0) { } // int(1)
How to get the STDERR exec part?
jolt source share