From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tassilo Horn Newsgroups: gmane.emacs.help Subject: Re: How to get the output of a command? Date: Fri, 21 Nov 2014 17:31:06 +0100 Message-ID: <87sihc8qid.fsf@thinkpad-t440p.tsdh.org> References: <87389cr2tb.fsf@wmi.amu.edu.pl> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1416587504 10318 80.91.229.3 (21 Nov 2014 16:31:44 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 21 Nov 2014 16:31:44 +0000 (UTC) Cc: Help Gnu Emacs mailing list To: Marcin Borkowski Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Nov 21 17:31:37 2014 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Xrr7R-0004LD-Ot for geh-help-gnu-emacs@m.gmane.org; Fri, 21 Nov 2014 17:31:37 +0100 Original-Received: from localhost ([::1]:41395 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xrr7R-0003mK-3B for geh-help-gnu-emacs@m.gmane.org; Fri, 21 Nov 2014 11:31:37 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47797) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xrr7A-0003lF-TZ for help-gnu-emacs@gnu.org; Fri, 21 Nov 2014 11:31:26 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xrr73-00026t-3q for help-gnu-emacs@gnu.org; Fri, 21 Nov 2014 11:31:20 -0500 Original-Received: from out4-smtp.messagingengine.com ([66.111.4.28]:47832) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xrr72-00026m-TT for help-gnu-emacs@gnu.org; Fri, 21 Nov 2014 11:31:13 -0500 Original-Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 7851C20BE4 for ; Fri, 21 Nov 2014 11:31:12 -0500 (EST) Original-Received: from frontend2 ([10.202.2.161]) by compute3.internal (MEProxy); Fri, 21 Nov 2014 11:31:12 -0500 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=x-sasl-enc:from:to:cc:subject:references :date:in-reply-to:message-id:mime-version:content-type; s= smtpout; bh=R+hlzd9zZ/Cf4Ap2vjdcYwBf0Y4=; b=Ij3OGO6RcAyq70tMuVTj BL7CBJeaI+edhtMI8Jp/oiQyAblScNy0B9oQR7Lec/sdIEE/mDConU79sRflouiS 0Yq9M4HGwX/pPMbt2q3dhmHWoT/UW4ddv7DSH8r/imVG9plOiSawvprSYbSkvhJb EfxB5B3U8ME+lCyl6r88O0I= X-Sasl-enc: sC8vSgWJDbmx6U7IeggkYLS3TLMawaxiwkOvcDne/7+Z 1416587471 Original-Received: from thinkpad-t440p.tsdh.org (unknown [2.163.251.229]) by mail.messagingengine.com (Postfix) with ESMTPA id ABB566800B4; Fri, 21 Nov 2014 11:31:11 -0500 (EST) Mail-Followup-To: Marcin Borkowski , Help Gnu Emacs mailing list In-Reply-To: <87389cr2tb.fsf@wmi.amu.edu.pl> (Marcin Borkowski's message of "Fri, 21 Nov 2014 17:17:50 +0100") User-Agent: Gnus/5.130012 (Ma Gnus v0.12) Emacs/25.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 66.111.4.28 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 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-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:101109 Archived-At: Marcin Borkowski writes: Hi Marcin, > I'd like to run some shell command and then receive its output *as the > value of some expression*. IOW, I'd like to do this: > > (setq output (do-magic "echo Whatever")) > > so that `output's value is the string "Whatever". > > What should I put in place of do-magic? ,----[ C-h f shell-command-to-string RET ] | shell-command-to-string is a compiled Lisp function in `simple.el'. | | (shell-command-to-string COMMAND) | | Execute shell command COMMAND and return its output as a string. `---- Bye, Tassilo