]> git.eshelyaron.com Git - emacs.git/commitdiff
(shell-command-to-string): New function.
authorRichard M. Stallman <rms@gnu.org>
Tue, 24 Sep 1996 20:04:48 +0000 (20:04 +0000)
committerRichard M. Stallman <rms@gnu.org>
Tue, 24 Sep 1996 20:04:48 +0000 (20:04 +0000)
lisp/simple.el

index 6a838e691e169f90e68330fe50036237cd1e91c0..718b0b8ef3fdee8b076d6ca759a40c7c3f9f94d5 100644 (file)
@@ -941,6 +941,11 @@ In either case, the output is inserted after point (leaving mark after it)."
                   (set-buffer buffer)
                   (goto-char (point-min)))
                 (display-buffer buffer))))))))
+       
+(defun shell-command-to-string (command)
+  "Execute shell command COMMAND and return its output as a string."
+  (with-output-to-string
+    (call-process shell-file-name nil t nil "-c" command)))
 \f
 (defconst universal-argument-map
   (let ((map (make-sparse-keymap)))