foreign-c-libraries/retropikzel/system/README.md

34 lines
817 B
Markdown

Execute a shell command.
Built upon [(foreign c)](https://sr.ht/~retropikzel/foreign-c/).
[Repository](https://git.sr.ht/~retropikzel/foreign-c-system)
[Issue tracker](https://sr.ht/~retropikzel/foreign-c/trackers)
[Maling lists](https://sr.ht/~retropikzel/foreign-c/lists)
[Jenkins](https://jenkins.scheme.org/job/retropikzel/job/foreign-c-system/)
(**system** _command_)
_command_ is a string containing the command you want to run.
Returns the exit code of the command.
Example:
(import (scheme base)
(scheme write)
(scheme file)
(retropikzel system))
(define testfile "test.txt")
(system (apply string-append `("echo \"Hello\" > " ,testfile)))
(define text (with-input-from-file testfile (lambda () (read-line))))
(display text)
(newline)