diff options
author | Peter Bex <peter@more-magic.net> | 2012-10-02 00:14:31 +0100 |
---|---|---|
committer | Peter Bex <peter@more-magic.net> | 2012-10-02 00:14:31 +0100 |
commit | aa8b8adf9492108580194a49fd98888a6dbc1909 (patch) | |
tree | 216ce3effe36261765089987267df6108e469a84 | |
parent | 4d6a0700a6f38f8ca26fa47cfa2e68015bfbd9cc (diff) | |
download | scsh-process-aa8b8adf9492108580194a49fd98888a6dbc1909.tar.gz |
Implement <<-redirection
-rw-r--r-- | scsh-process.scm | 3 | ||||
-rw-r--r-- | tests/run.scm | 2 |
2 files changed, 3 insertions, 2 deletions
diff --git a/scsh-process.scm b/scsh-process.scm index 57a773e..2700640 100644 --- a/scsh-process.scm +++ b/scsh-process.scm @@ -229,7 +229,8 @@ (duplicate-fileno (file-open (maybe-symbol->string `?file-name) open/rdonly) `?fd)) - ((_ (<< ?fd ?object)) (error "<< currently not implemented")) + ((_ (<< ?fd ?object)) + (fork/pipe (lambda () (display ?object)))) ((_ (= ?fd-from ?fd/port-to)) (let* ((fd/port-to ?fd/port-to) ; Evaluate once (fd-to (if (port? fd/port-to) diff --git a/tests/run.scm b/tests/run.scm index df73ac3..fbb1019 100644 --- a/tests/run.scm +++ b/tests/run.scm @@ -47,7 +47,7 @@ (test "Redirecting from object" '("blah" "foo" "testing, 1 2 3") - (run/strings (cat tmpfile -) (<< "testing, 1 2 3"))) + (run/strings (cat ,tmpfile -) (<< "testing, 1 2 3"))) (delete-file* tmpfile))) (test-group "Subprocesses" |