I have a PHP project that runs a bash code under php file.
When I try to run this command under bash, everything works ok. But in my PHP code, it gives me a syntax error for some reason.
PHP Code I am having issue with;
exec('comm -13 <(sort ' . $path_d_raw.$least_recent_raw_file . ') <(sort ' . $path_d_raw.$most_recent_raw_file . ') > test.txt 2>&1', $output, $return);
Error output
sh: -c: line 0: syntax error near unexpected token `('
sh: -c: line 0: `comm -13 <(sort /path/to/file/file_01.ext) <(sort /path/to/file/file_02.ext) > test.txt 2>&1'
But when I try to run this command under terminal, it works;
comm -13 <(sort /path/to/file/file_01.ext) <(sort /path/to/file/file_02.ext) > test.txt 2>&1
I think there are problems with ` or ' but couldn't get rid of them.
Thanks in advance for any suggestion.