From 4dfa9485f958f82624bebea8f60e915eab236430 Mon Sep 17 00:00:00 2001 From: Ben Sima Date: Fri, 30 Dec 2022 10:42:50 -0500 Subject: Add #$ reader macro for shell commands --- bs/shell.scm | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'bs/shell.scm') diff --git a/bs/shell.scm b/bs/shell.scm index 8dea64f..3a5d276 100644 --- a/bs/shell.scm +++ b/bs/shell.scm @@ -30,3 +30,16 @@ (define (cd path) (chdir path) (ls)) + +;; run shell commands with #$"cmd args" +;; #$"who" +;; ben tty7 2022-11-07 20:31 (:0) +(read-hash-extend + #\$ + (lambda (c port) + (let ((input (read port))) + ;; todo: + ;; - parse input for #{interpolations} + ;; - evaluate scheme code inside the blocks + ;; - then exec this + `(exec ,input)))) -- cgit v1.2.3