I am trying to call a shell script loop using the shell_exec()
php function but with no avail.
I can do shell_exec("ls")
with no problem.
I can ssh to the server and do for f in
ls; do echo $f ; done
with no problem.
But when I combine the two,
shell_exec("for f in `ls` ; do echo $f ; done")
I get nothing as output (nor NULL as error, I checked).
What am I missing here?
P.S: The for loop I am using here is not one I intend to use, it's just to make it clearer.