From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Marijn Schouten (hkBst)" Newsgroups: gmane.lisp.guile.user Subject: Re: pipelines Date: Mon, 30 Mar 2009 11:26:21 +0200 Message-ID: <49D0903D.7070704@gentoo.org> References: <49CE1DCA.8070604@gentoo.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1238405336 7035 80.91.229.12 (30 Mar 2009 09:28:56 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 30 Mar 2009 09:28:56 +0000 (UTC) Cc: guile-user@gnu.org To: Andy Wingo Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Mon Mar 30 11:30:13 2009 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1LoDoF-0000bw-9L for guile-user@m.gmane.org; Mon, 30 Mar 2009 11:29:35 +0200 Original-Received: from localhost ([127.0.0.1]:42816 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LoDmr-0005PJ-Pj for guile-user@m.gmane.org; Mon, 30 Mar 2009 05:28:09 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LoDlp-0005Bf-2x for guile-user@gnu.org; Mon, 30 Mar 2009 05:27:05 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LoDlj-0005A7-OD for guile-user@gnu.org; Mon, 30 Mar 2009 05:27:04 -0400 Original-Received: from [199.232.76.173] (port=34797 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LoDlj-0005A1-G8 for guile-user@gnu.org; Mon, 30 Mar 2009 05:26:59 -0400 Original-Received: from castor.sshunet.nl ([145.97.192.41]:55856) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LoDlj-0000xr-7C for guile-user@gnu.org; Mon, 30 Mar 2009 05:26:59 -0400 Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by castor.sshunet.nl (Postfix) with ESMTP id 1CAD357C00A; Mon, 30 Mar 2009 11:26:58 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at castor.sshunet.nl Original-Received: from castor.sshunet.nl ([127.0.0.1]) by localhost (castor.sshunet.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id QUSLee5cg-CO; Mon, 30 Mar 2009 11:26:58 +0200 (CEST) Original-Received: from [145.97.223.18] (18pc223.sshunet.nl [145.97.223.18]) by castor.sshunet.nl (Postfix) with ESMTP; Mon, 30 Mar 2009 11:26:57 +0200 (CEST) User-Agent: Thunderbird 2.0.0.21 (X11/20090320) In-Reply-To: X-Enigmail-Version: 0.95.7 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.user:7188 Archived-At: -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Andy Wingo wrote: > Hi Marijn, > > On Sat 28 Mar 2009 05:53, "Marijn Schouten (hkBst)" writes: > >> how would I construct a pipeline with guile? Currently my best attempt which >> turns to nothing is: >> >> guile> (use-modules (ice-9 popen)) >> guile> (with-output-to-port (open-pipe "echo" OPEN_WRITE) (lambda () >> (with-input-from-port (open-pipe* OPEN_READ "echo" "Hello world") (lambda () >> (display (readline)))))) > > What do you mean by "pipeline"? Do you want to spawn off "echo foo | > bar", or write data to "bar", or read data from "echo foo" ? > > Andy By pipeline I mean for example: echo "Hello world" | cat | cat | cat | grep world | cat I know how to create such pipelines that contain only a single pipe. My question is about how to do it when there are many pipes. Marijn - -- Gods do not want you to think, lest they lose existence. Religions do not want you to think, lest they lose power. Marijn Schouten (hkBst), Gentoo Lisp project, Gentoo ML , #gentoo-{lisp,ml} on FreeNode -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.11 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAknQkD0ACgkQp/VmCx0OL2xg9QCfXpQiYE8NRW3jwKXwWT2/CMeG 4T0AnjjtydzaLNQb7qBp639Qd2UqHbR4 =lAkP -----END PGP SIGNATURE-----