I have a command I need to run in a shell:
/usr/bin/mogrify -size 180x180 -colors 256 -colorspace RGB +profile
"*" /usr/shipthumbs/*.tif
I've tried doing this:
$mog = "/usr/bin/mogrify -size 180x180 -colors 256 -colorspace RGB
+profile \"*\" /usr/shipthumbs/*.tif";
exec("$mog 2>&1", $output);
and
$mog = escapeshellcmd("/usr/bin/mogrify -size 180x180 -colors 256
-colorspace RGB +profile \"*\" /usr/shipthumbs/*.tif");
exec("$mog 2>&1", $output);
and
$mog = escapeshellcmd('/bin/bash -c "/usr/bin/mogrify -size 180x180
-colors 256 -colorspace RGB +profile "*" /usr/shipthumbs/*.tif'");
exec("$mog 2>&1", $output);
And no matter when I do, when that PHP script runs and I do a "ps aux"
I see the command line it's running always has the quotes that NEED to
be there ( "*" ) wrong.
either it's "\*" (yes I have the slash in the right place) or just *
without the quotes.
What's thr right way to formulate an exec() or an escapeshellcmd() so
that double quotes that HAVE to be sent to the shell get there?
Thanks!!
Liam