Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Owning and controlling child processes in scripts?



2009/4/3 Johann "Myrkraverk" Oskarsson <johann@xxxxxxxxxxxxxx>:
> Hi all,
>
> Is it possible to keep a child process, and communicate with it using
> stdin and stdout in a script?
>
> More specifically, can I spawn a sqlite process, and pipe into it an
> sql command, as needed?  Or am I condemned to spawn a new process on
> each command?

Look up coproc
simple example
% coproc cat
% echo hello >&p
% cat <&p
hello

-- 
Mikael Magnusson



Messages sorted by: Reverse Date, Date, Thread, Author