summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Bex <peter@more-magic.net>2012-10-02 00:14:31 +0100
committerPeter Bex <peter@more-magic.net>2012-10-02 00:14:31 +0100
commitaa8b8adf9492108580194a49fd98888a6dbc1909 (patch)
tree216ce3effe36261765089987267df6108e469a84
parent4d6a0700a6f38f8ca26fa47cfa2e68015bfbd9cc (diff)
downloadscsh-process-aa8b8adf9492108580194a49fd98888a6dbc1909.tar.gz
Implement <<-redirection
-rw-r--r--scsh-process.scm3
-rw-r--r--tests/run.scm2
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"