tobold.org

correct • elegant • free

△ comp.lang.perl △

◅ Sorting Associative Arrays

Help with removing a line from a file ▻

Need to fork and exec and pipe!

In article <4f88op$9gq@news.eecs.uic.edu>,
Asoka Desaram <adesaram@bert.eecs.uic.edu> wrote:
>I want to be able to fork off a process and exec a command (passwd).
>I would like to be able to read and write from the exec("passwd") process
>but I don't know how to do it .  Does anyone have an example of this?

See question 5.14 in the FAQ.

I'd recommend the chat2.pl solution: in the case of passwd this is
probably the only one that will work, since many implementations
of passwd take input from /dev/tty, not stdin.

Tim.
--
Tim Goodwin   | "Forget the mystical level numbers." -- Henry Spencer

Original headers:

From: tim@pipex.net (Tim Goodwin)
Newsgroups: comp.lang.perl.misc
Subject: Re: Need to fork and exec and pipe!
Date: 8 Feb 1996 16:36:34 GMT
Organization: Unipalm PIPEX
Message-ID: <4fd8qi$frt@wave.news.pipex.net>
References: <4f88op$9gq@news.eecs.uic.edu>

△ comp.lang.perl △

◅ Sorting Associative Arrays

Help with removing a line from a file ▻