I have the following command within a PHP script:
shell_exec('cd /home/scripts/scripts; ./total.sh | jq '.hits .hits [] .fields["termListData.terms"] | .[]' | wc -l > /home/data/total.csv');
which gives me: PHP Fatal error: Cannot use [] for reading ...
the command alone from the command line works perfect but not when within the php script. What I am doing wrong?