Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Owning and controlling child processes in scripts?
- X-seq: zsh-users 13993
- From: Mikael Magnusson <mikachu@xxxxxxxxx>
- To: Johann Myrkraverk Oskarsson <johann@xxxxxxxxxxxxxx>
- Subject: Re: Owning and controlling child processes in scripts?
- Date: Fri, 3 Apr 2009 20:58:07 +0200
- Cc: Zsh Users <zsh-users@xxxxxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed;        d=gmail.com; s=gamma;        h=domainkey-signature:mime-version:received:in-reply-to:references         :date:message-id:subject:from:to:cc:content-type         :content-transfer-encoding;        bh=cC3faDZgoESY71torpTV20Db6Qv91N5dYeXxgLjvDpA=;        b=fBnBN4v8Fz8VNaCxLgZ9C8h47K/0cze9XN/QqRpG99NTW5C4Zj4ZX8myGEhePBJXni         pWUFtNDJYTfWbgpO4/G4tyQoF38gb78fLC/iO/AHN8YvdU8znWOAlEpEamVbW1GeNAe8         +pDwpvKFuJKPrYuBximXadBMlnDVt4h6hjB9o=
- Domainkey-signature: a=rsa-sha1; c=nofws;        d=gmail.com; s=gamma;        h=mime-version:in-reply-to:references:date:message-id:subject:from:to         :cc:content-type:content-transfer-encoding;        b=FNKXqe3Ef0qPhrxfjSIghEJHX0+AvUrU1jpie5lHDw7kiF5PwPKxoXYYGmNCICtiHF         I9KuFMhFohsKAliBajij7ND/H2/Uib90jaJAkiYy1IxIvcEYzg0ZwIXS4Ol4VRggdHC3         pFAtsrWKfhc4hwe+KtKJQBFyRCHBDvMKlw1yM=
- In-reply-to: <cb59c2d10904031152p13bd8124me9adabf5a3560c8d@xxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <cb59c2d10904031152p13bd8124me9adabf5a3560c8d@xxxxxxxxxxxxxx>
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