"if I print out the exec line with the
dynamically generated paths, etc, then execute that through the terminal, no
problem. "

>From the first email meaning that I did just like you suggested already and
it works in the terminal and contains exactly what I expect it to.

But thanks :)


On 7/15/03 6:09 PM, "David Nicholson" <[EMAIL PROTECTED]> wrote:

> Hello,
> 
> This is a reply to an e-mail that you wrote on Tue, 15 Jul 2003 at 21:30,
> lines prefixed by '>' were originally written by you.
>> I have the following exec command in php:
>> exec("/bin/sed -f $GLOBALS[TMP_MAIL_DIR]"."cmdfile
>> $GLOBALS[TMP_MAIL_DIR]"."$mailid >
>> $GLOBALS[TMP_MAIL_DIR]"."$mailid"."tmp",$results);
>> Which does a search and replace using the sed command file:
>> s/'/'/g
>> s/"/"/g
>> Now, executed command line, this works beautifully, the input file is
>> parsed
>> and the results go to the output file - BUT when run via php, the
>> output
>> file is blank, empty, no data at all.
>> Permissions are not the problem, I went so far as to 777 the directory
>> and
>> file, still the same results.
>> Running PHP 4.1.2 on Linux Redhat something or another.
>> I am sure that it is something simple, but it is driving me crazy!
>> Oh, and yes, globals are on here - if I print out the exec line with
>> the
>> dynamically generated paths, etc, then execute that through the
>> terminal, no
>> problem.
>> If anyone has run into this with exec commands before or can suggest a
>> different way to run this command, I would love to hear it!
> 
> Put this line of code in your script:
> 
> echo "/bin/sed -f $GLOBALS[TMP_MAIL_DIR]"."cmdfile
> $GLOBALS[TMP_MAIL_DIR]"."$mailid >
> $GLOBALS[TMP_MAIL_DIR]"."$mailid"."tmp";
> 
> and check that it contains what you expect it to.
> 
> All the best,
> 
> David.

--
Cheers

Mike Morton

****************************************************
*
* Tel: 905-465-1263
* Email: [EMAIL PROTECTED]
*
****************************************************

"Indeed, it would not be an exaggeration to describe the history of the
computer industry for the past decade as a massive effort to keep up with
Apple."
- Byte Magazine

Given infinite time, 100 monkeys could type out the complete works of
Shakespeare. Win 98 source code? Eight monkeys, five minutes.
-- NullGrey 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to