A Clojure library shakes your shell.
[shake "0.1.1"]
(use 'shake.core)
;; any shell command ...
(uname -a) ;;returns a #<UNIXProcess java.lang.UNIXProcess@1833160>
;; if you just want to see the output:
(binding [*print-output* true]
(uname -a))
shake extends Process
with clojure's IOFactory. So you can
(input-stream)
or (output-stream)
the process to get a streamed
I/O.
;; print output of `uname -a`
(print (slurp (input-stream (uname -a))))
By default, shake indexes all executables under your PATH. To
override this behavior, set environment variable SHAKE_PATH
before you initialize the namespace shake.core
.
Copyright © 2012 Sun Ning [email protected]
Distributed under the Eclipse Public License, the same as Clojure.