From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Jean Louis Newsgroups: gmane.emacs.help Subject: Re: How to run shell command with stream input, to get string output Date: Mon, 1 Jul 2019 11:06:23 +0200 Organization: START YOUR OWN GOLD MINE Message-ID: <20190701090623.GD11749@protected.rcdrun.com> References: <20190630223205.GA19895@protected.rcdrun.com> <875zomw7cf.fsf@mbork.pl> <20190701081716.GA11749@protected.rcdrun.com> <20190701083833.GA25877@tuxteam.de> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="93875"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Mutt/1.10.1 (2018-07-13) Cc: help-gnu-emacs@gnu.org To: tomas@tuxteam.de Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Jul 01 11:07:44 2019 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hhsHn-000OIP-Gq for geh-help-gnu-emacs@m.gmane.org; Mon, 01 Jul 2019 11:07:43 +0200 Original-Received: from localhost ([::1]:53952 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hhsHm-0000fI-Fz for geh-help-gnu-emacs@m.gmane.org; Mon, 01 Jul 2019 05:07:42 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:43872) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hhsGj-0000F5-2d for help-gnu-emacs@gnu.org; Mon, 01 Jul 2019 05:06:38 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hhsGe-00034J-N5 for help-gnu-emacs@gnu.org; Mon, 01 Jul 2019 05:06:36 -0400 Original-Received: from stw1.rcdrun.com ([217.170.207.13]:57141) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hhsGb-0002z6-39 for help-gnu-emacs@gnu.org; Mon, 01 Jul 2019 05:06:30 -0400 Original-Received: from protected.rcdrun.com (localhost [::1]) (AUTH: PLAIN admin, TLS: TLS1.2,256bits,ECDHE_RSA_AES_256_GCM_SHA384) by stw1.rcdrun.com with ESMTPSA; Mon, 01 Jul 2019 02:06:24 -0700 id 000000000002035C.000000005D19CD10.000073A2 Original-Received: from localhost (protected.rcdrun.com [local]) by protected.rcdrun.com (OpenSMTPD) with ESMTPA id 98dac423; Mon, 1 Jul 2019 09:06:24 +0000 (UTC) Content-Disposition: inline In-Reply-To: <20190701083833.GA25877@tuxteam.de> X-Mime-Autoconverted: from 8bit to quoted-printable by courier 0.76.3 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 217.170.207.13 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:121082 Archived-At: * tomas@tuxteam.de [2019-07-01 10:39]: > Perhaps call-process-region is for you: it passes the current > region as stdin to the invoked process. Cf [1]. If you need > more control (or perhaps an asynchronous process which you can > feed input spoonwise), perhaps [2] is it. But that takes some > "bricolage" :-) >=20 > Cheers >=20 > [1] Elisp manual 38.3 Creating a Synchronous Process > [2] Elisp manual 38.7 Sending Input to Processes > -- tom=C3=A1s Thank you, I found this one, now just to figure out how to find process name. -- Function: process-send-string process string This function sends PROCESS the contents of STRING as standard input. It returns =E2=80=98nil=E2=80=99. For example, to make a Sh= ell buffer list files: (process-send-string "shell<1>" "ls\n") =E2=87=92 nil