From xemacs-m  Sat May 24 18:59:47 1997
Received: from bittersweet.inetarena.com (karlheg@bittersweet.inetarena.com [206.129.216.38])
	by xemacs.org (8.8.5/8.8.5) with ESMTP id SAA28427
	for <xemacs-beta@xemacs.org>; Sat, 24 May 1997 18:59:46 -0500 (CDT)
Received: (from karlheg@localhost)
	by bittersweet.inetarena.com (8.8.5/8.8.5) id QAA05149;
	Sat, 24 May 1997 16:59:05 -0700
Date: Sat, 24 May 1997 16:59:05 -0700
Message-Id: <199705242359.QAA05149@bittersweet.inetarena.com>
From: "Karl M. Hegbloom" <karlheg@inetarena.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
To: <xemacs-beta@xemacs.org>
Subject: shell-command-to-string
X-Mailer: VM 6.31 under 20.3 XEmacs Lucid (beta2)
X-Face: /Q}=yl}1_v7nP)xXo5XjG8+tl@=uVu7o5u6)f]zN?+<hB!K.m9:[|*p34jVN`O;:XZXVSy>/\R>qDt(t8w!-i{(y0"`jFw^uk8inzO9wXabd'CdjUWfC\GHi:6nO*YC89#-qD>Q4r%9!V"<RYJ=7D#$";q=zML5'!=wvXk^$`6FT=5CMofQX)WUKt0p:OKl.mFOXx/D
Comments: Hyperbole mail buttons accepted, v04.023.


 Here's my contribution for today...

 Does something like this already exist anywhere???  What file does it
belong in?  (I've put it in site-start.el)

8<----------------------------------------------------------------->8
(defun shell-command-to-string (command)
  "Run a shell command and return the result as a string."
  (let ((buff (get-buffer-create " *command-to-string*"))
	 string)
    (shell-command command buff)
    (save-excursion
      (set-buffer buff)
      (setq string (buffer-substring
		    (point-min)
		    (point-max)
		    buff)))
    (kill-buffer buff)
    string))
8<----------------------------------------------------------------->8

-- 
Karl M. Hegbloom <karlheg@inetarena.com>
http://www.inetarena.com/~karlheg
Portland, OR  USA
Debian GNU 1.2  Linux 2.1.36 AMD K5 PR-133

