----- Original Message -----
From: "Jean-Christian Imbeault" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, January 08, 2003 9:52 AM
Subject: [PHP] EOF: how to generate one in a string


> I am trying to use a command line program in Linux using this form:
>
> $result = `/path/prog $arg`;
>
> But this doesn't work as the program is expecting and EOF that never
comes.
>
> If I use the program on the command line when I am finished entering all
> the data I need to hit return and then CTRL-D to give an EOF.
>
> How can I simulate this using the backticks?
If $arg is, what you would enter in the command line, you need to pass it to
prog's stdin. You could use
`echo "$arg" | /path/prog` for example. If $arg is more that just a single
line w/o special characters, you should probably use popen for more control
(is it popen in php?...)



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

Reply via email to