using quotes in exec( ) or escapeshellcmd( )
From: LRW (deja_at_celticbear.com)
Date: 06/29/04
- Next message: Janwillem Borleffs: "Re: session_start doesn't allocate a new id?"
- Previous message: LRW: "sorting an array based on one of many form fields?"
- Next in thread: Alvaro G Vicario: "Re: using quotes in exec( ) or escapeshellcmd( )"
- Reply: Alvaro G Vicario: "Re: using quotes in exec( ) or escapeshellcmd( )"
- Reply: LRW: "Re: using quotes in exec( ) or escapeshellcmd( )"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 29 Jun 2004 13:21:57 -0700
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
- Next message: Janwillem Borleffs: "Re: session_start doesn't allocate a new id?"
- Previous message: LRW: "sorting an array based on one of many form fields?"
- Next in thread: Alvaro G Vicario: "Re: using quotes in exec( ) or escapeshellcmd( )"
- Reply: Alvaro G Vicario: "Re: using quotes in exec( ) or escapeshellcmd( )"
- Reply: LRW: "Re: using quotes in exec( ) or escapeshellcmd( )"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|