Created
February 27, 2019 01:32
-
-
Save jakemcc/e0853fd42fb59f6c202f879cc493c365 to your computer and use it in GitHub Desktop.
weird.clj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
qqq.core> (require '[clojure.java.shell :as shell]) | |
nil | |
;; Kick off a future that is reading System/in and just print the result | |
qqq.core> (future | |
(println (.read System/in)) | |
(println "done")) | |
#<Future@536d8f5e: :pending> | |
;; Invoke something that uses /bin/sh, see the output | |
qqq.core> (shell/sh "/bin/sh" "-c" "echo yolo") | |
{:exit 0, :out "yolo\n", :err ""} | |
;; Use /bin/bash, notice output from (.read System/in) returning -1 and future finishing | |
qqq.core> (shell/sh "/bin/bash" "-c" "echo yolo") | |
-1 | |
done | |
{:exit 0, :out "yolo\n", :err ""} | |
;; Any ideas what is going on? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment