Re: Interactive PHP script from commandline
| From: | Philip Olson | Date: | Wed, 27 Dec 2000 20:40:10 +0000 |
| Subject: | Re: Interactive PHP script from commandline | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-32004@lists.php.net to get a copy of this message | ||
Hello Ollie,
This tutorial may help you :
Using PHP As A Shell Scripting Language :
by Darrell Brogdon
http://phpbuilder.com/columns/darrell20000319.php3
It explains passing/returning arguments in shell with PHP.
Regards,
Philip
On Wed, 27 Dec 2000 o.cook@etoncollege.org.uk wrote:
> I've compiled PHP to a binary that I can run from the UNIX commandline.
>
> If I try to execute a command from a script, it doesn't seem interactive; it
> still accepts the input and acts on it; but you can't see the prompts.
>
> For example if I try to run 'passwd' I get this:
>
> <enter password>
> <enter password again>
> <enter password again>
> Changing password for test_user
> Enter the new password (minimum of 5, maximum of 127 characters)
> Please use a combination of upper and lower case letters and numbers.
> New password:Bad password: too simple.
> Warning: weak password (enter it again to use it anyway).
> New password:Re-enter new password:Password changed.
>
> You see how it doesn't show the "weak password" prompts or anything similar
> (obviously dependant on input) until after the command has been executed.
>
> Is it possible to somehow run the command interactively? I tried system(),
> exec(), passthru() and the backticks on Slackware 7.0.
>
> Regards,
>
> Ollie
>
> ---
> Do radioactive cats have 18 half-lives?
>
> http://pgpkeys.mit.edu:11371/pks/lookup?op=get&search=0x53D29567
> ---
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>