Interactive PHP script from commandline
| From: | o dot cook at etoncollege dot org dot uk | Date: | Wed, 27 Dec 2000 20:33:29 +0000 |
| Subject: | Interactive PHP script from commandline | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-32000@lists.php.net to get a copy of this message | ||
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
---