From aa8b8adf9492108580194a49fd98888a6dbc1909 Mon Sep 17 00:00:00 2001 From: Peter Bex Date: Tue, 2 Oct 2012 00:14:31 +0100 Subject: Implement <<-redirection --- scsh-process.scm | 3 ++- 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" -- cgit v1.2.3