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 <jinsongli...@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