Re: How to work with external programs like 'passwd'
| From: | Marek Kilimajer | Date: | Fri, 23 May 2003 14:29:25 +0000 |
| Subject: | Re: How to work with external programs like 'passwd' | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-148772@lists.php.net to get a copy of this message | ||
You need to use expect command with exec or popen
Branko F. Gračnar wrote:
Hi there! I'm starting new PHP project, which will utilize GPG system executable. GPG asks for some operations for password input. Programs like passwd and gpg open new session, when they ask for password, so there is not simple possible to: echo $password | gpg <options>... In perl, there is Expect package to deal with such programs. You can use IPC::Open2 or IPC::Open3 too. Any informations/links/whatever regarding this topis would be very appreciated. Best regards, Brane