help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to get the output of a command?


From: Tassilo Horn
Subject: Re: How to get the output of a command?
Date: Fri, 21 Nov 2014 17:31:06 +0100
User-agent: Gnus/5.130012 (Ma Gnus v0.12) Emacs/25.0.50 (gnu/linux)

Marcin Borkowski <mbork@wmi.amu.edu.pl> 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]