mit-scheme-devel
[Top][All Lists]
Advanced

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

Re: two basic questions


From: Derek Rhodes
Subject: Re: two basic questions
Date: Sat, 16 Apr 2022 17:03:09 -0400

Hi Jinsong, I found a couple things that may help. To run a scheme script, this stackoverflow post seemed appropriate:

https://stackoverflow.com/questions/24720112/mit-scheme-run-a-script-and-exit

which boils down to:
$ mit-scheme --quiet --load program.scm --eval '(exit)'


For shelling out, or running subprocesses, this program worked as you requested:
file:program.scm starts
8< -----------------------------------------------------------

(load-option 'synchronous-subprocess)

(display (with-string-output-port
          (lambda (port)
            (run-shell-command "ls" 'output port))))


8< -----------------------------------------------------------
end-of-file

Here are the docs that helped:

https://www.gnu.org/software/mit-scheme/documentation/stable/mit-scheme-ref/Subprocesses.html
https://www.gnu.org/software/mit-scheme/documentation/stable/mit-scheme-ref/Subprocess-Options.html


On Thu, Apr 14, 2022 at 8:41 PM Jinsong Liang <jinsongliang@gmail.com> wrote:
Hi,

I am new to mit-scheme and I am not a scheme expert either. I did not find the answers to the following questions in the mit-scheme documentation:

1. How to run a scheme script?
2. How to run a system/shell command and get the output as strings using scheme code?

Thank you!

Jinsong

reply via email to

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