Re: shell_exec with pipes

From: Date: Wed, 12 Nov 2003 09:58:49 +0000
Subject: Re: shell_exec with pipes
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-169246@lists.php.net to get a copy of this message
On Wednesday 12 November 2003 17:21, Mario Ohnewald wrote: > > $var=shell_exec("/usr/local/bin/mplayer -identify -frames 0 > > /tmp/pitstop.mpeg 2>/dev/null | grep ID_LENGTH | cut -d \"=\" -f 2"); > > $var=shell_exec("/usr/local/bin/mplayer -identify -frames 0 > /tmp/pitstop.mpeg 2>/dev/null | grep ID_LENGTH | cut -d \"=\" -f 2"); > echo "Output: $var"; > > Still gives nothing back :/ > Told you, its not that easy :P Have you: 1) Turned on full error reporting? 2) Checked that (i) you're not running in safe_mode, or (ii) if you are, that you are allowed to access those executables? 3) Confirmed that the left side of the pipe is working and giving the expected output? 4) Tried giving the full path to grep? If you're still having trouble with it you can try sticking the above into a little shell script and shell_exec() the shell script instead. -- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * ------------------------------------------ Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general ------------------------------------------ /* Due to lack of disk space, this fortune database has been discontinued. */

« previous php.general (#169246) next »