This is the mail archive of the guile@cygnus.com mailing list for the Guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: shell-command-to-string



> hmmm, are there any other implementations of this?
> 
> just wondering,
> thi
> 
> 
> --------------------
> (define (shell-command-to-string cmd)
>   (with-output-to-string
>     (lambda ()
>       (let ((in-port (open-input-pipe cmd)))
> 	(let loop ((line (read-line in-port 'concat)))
> 	  (or (eof-object? line)
> 	      (begin
> 		(display line)
> 		(loop (read-line in-port 'concat)))))))))

I would like to do stuff like this with guile-scsh.  Scsh has already
defined how this stuff should work very elegantly, and I'd like to
start using it.  Actually, one of the things I'd like to do is to add
a bunch more recipes to the guile FAQ, maybe even stealing problems
from the middle section of the 'Programming Perl' book, and
demonstrating how they could be programmed with guile.

If anyone wants to contribute recipes, I'll add them to the guile FAQ
if you make the recipe public domain.  And I'd prefer if you use scsh
interfaces.

-russ

--
"Come to think of it, there are already a million monkeys on a million
 typewriters, and Usenet is NOTHING like Shakespeare."

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]