From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Andy Wingo Newsgroups: gmane.lisp.guile.bugs Subject: bug#23500: Manual:4.3 Guile Scripting: Show to a layman that Guile can invoke shell commands, which are common in bash scripts. Date: Tue, 28 Feb 2017 16:23:45 +0100 Message-ID: <87h93el4ou.fsf@pobox.com> References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1488296411 21535 195.159.176.226 (28 Feb 2017 15:40:11 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 28 Feb 2017 15:40:11 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) Cc: 23500-done@debbugs.gnu.org To: Evan Davis Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Tue Feb 28 16:40:03 2017 Return-path: Envelope-to: guile-bugs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cijsZ-0004Ja-Kk for guile-bugs@m.gmane.org; Tue, 28 Feb 2017 16:39:55 +0100 Original-Received: from localhost ([::1]:34149 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cijsf-00073V-Ih for guile-bugs@m.gmane.org; Tue, 28 Feb 2017 10:40:01 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:57769) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cijdF-0001YE-JH for bug-guile@gnu.org; Tue, 28 Feb 2017 10:24:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cijdC-0008RB-AO for bug-guile@gnu.org; Tue, 28 Feb 2017 10:24:05 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:33984) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cijdC-0008R0-4O for bug-guile@gnu.org; Tue, 28 Feb 2017 10:24:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1cijdB-0001UE-Uo for bug-guile@gnu.org; Tue, 28 Feb 2017 10:24:01 -0500 Resent-From: Andy Wingo Original-Sender: "Debbugs-submit" Resent-To: bug-guile@gnu.org Resent-Date: Tue, 28 Feb 2017 15:24:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 23500 X-GNU-PR-Package: guile X-GNU-PR-Keywords: Mail-Followup-To: 23500@debbugs.gnu.org, wingo@pobox.com, erdavis7@gmail.com Original-Received: via spool by 23500-done@debbugs.gnu.org id=D23500.14882954365699 (code D ref 23500); Tue, 28 Feb 2017 15:24:01 +0000 Original-Received: (at 23500-done) by debbugs.gnu.org; 28 Feb 2017 15:23:56 +0000 Original-Received: from localhost ([127.0.0.1]:60416 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cijd6-0001Tr-00 for submit@debbugs.gnu.org; Tue, 28 Feb 2017 10:23:56 -0500 Original-Received: from pb-sasl2.pobox.com ([64.147.108.67]:61620 helo=sasl.smtp.pobox.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cijd4-0001Tj-Dx for 23500-done@debbugs.gnu.org; Tue, 28 Feb 2017 10:23:54 -0500 Original-Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by pb-sasl2.pobox.com (Postfix) with ESMTP id E5D7E5F597; Tue, 28 Feb 2017 10:23:53 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type:content-transfer-encoding; s=sasl; bh=Fu5MK2NN/MxP 5Im2oEO1jOAUPLA=; b=S2ImxVF5QN+c+zhW9liNQzS86Y34oe5n4pdILFGRIdge 3w6WbaUy1kF/XqOofLuNLITdWZsnulRXEfKTBTAHBlNRPbN9Hlv7mx1IYuRugUTY JL6RhnrJkYTIydbyU4xvwfL0gu9NcG49+Nmy0xeXnd29L16BelRCVp5vk0Z7VRc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type:content-transfer-encoding; q=dns; s=sasl; b=XrWPyJ eQ8mYF8UZpr3iYtV9D7wk+oJjCu3CDFEFK7noQfgr2zHaJ4dBeH+CZfO8eN4OiEF Fe0LTIM6ntncodMdlDFKD716CgKYa0pOKRro4DV47GvKxE8VDlF8YzyqnfJPxK/A cUosvC+8YJGe5iZaES/yIoUmpovRaWDpkmBOI= Original-Received: from pb-sasl2.nyi.icgroup.com (unknown [127.0.0.1]) by pb-sasl2.pobox.com (Postfix) with ESMTP id DDC275F596; Tue, 28 Feb 2017 10:23:53 -0500 (EST) Original-Received: from clucks (unknown [88.160.190.192]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by pb-sasl2.pobox.com (Postfix) with ESMTPSA id 007E85F595; Tue, 28 Feb 2017 10:23:52 -0500 (EST) In-Reply-To: (Evan Davis's message of "Mon, 9 May 2016 18:48:26 -0400") X-Pobox-Relay-ID: E9B90A7A-FDC9-11E6-BBF9-6141F2301B6D-02397024!pb-sasl2.pobox.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-guile@gnu.org List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Original-Sender: "bug-guile" Xref: news.gmane.org gmane.lisp.guile.bugs:8593 Archived-At: On Tue 10 May 2016 00:48, Evan Davis writes: > In =C2=A74.3 (Guile Scripting) please mention =C2=A77.2.7 (Processes), or= at > least the system/system* and open-pipe procedures. Maybe include an > example of a guile script invoking shell commands, as is common in > bash. As a layman, the manual's scripting section left me unsure > whether Guile could easily replace my typical bash scripts, and I > needed further help from Wingo on . Tx for the report. Added this text to the end of the section: Finally, seasoned scripters are probably missing a mention of subprocesses. In Bash, for example, most shell scripts run other programs like @code{sed} or the like to do the actual work. In Guile it's often possible get everything done within Guile itself, so do give that a try first. But if you just need to run a program and wait for it to finish, use @code{system*}. If you need to run a sub-program and capture its output, or give it input, use @code{open-pipe}. @xref{Processes}, and @xref{Pipes}, for more information. Andy