[gambit-list] Bashing in scheme?

Joel J. Adamson jadamson at partners.org
Wed Apr 23 12:03:55 EDT 2008


David St-Hilaire <sthilaid at iro.umontreal.ca> writes:

> Hello all!
>
> I'd like a little help with some bash style scripting that I would like to do in 
> my gambit repl.
>
> How can I do in scheme what I would do in bash like f1 < input-file | f2, where 
> f1 and f2 are 2 scheme functions reading and writing to stdin and stdout 
> respectively.
>
> I know that the < input-file part is done with
> (with-input-from-file input-file (lambda () f1)
> put it is the pipe part that remains obscur to me...

(shell-command "...")

FYI this returns the exit status of the program, not its output.

Joel

-- 
Joel J. Adamson
Biostatistician
Pediatric Psychopharmacology Research Unit
Massachusetts General Hospital
Boston, MA  02114
(617) 643-1432
(303) 880-3109
Public key: http://pgp.mit.edu
http://www.unc.edu/~adamsonj

The information transmitted in this electronic communication is intended only
for the person or entity to whom it is addressed and may contain confidential
and/or privileged material. Any review, retransmission, dissemination or other
use of or taking of any action in reliance upon this information by persons or
entities other than the intended recipient is prohibited. If you received this
information in error, please contact the Compliance HelpLine at 800-856-1983 and
properly dispose of this information.






More information about the Gambit-list mailing list