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. -- phpmachine :: The quick and easy to use service providing you with professionally developed PHP scripts :: http://www.phpmachine.com/ Professional Web Development by David Nicholson http://www.djnicholson.com/ QuizSender.com - How well do your friends actually know you? http://www.quizsender.com/ (developed entirely in PHP) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php