Skip to content

Instantly share code, notes, and snippets.

@asimjalis
Created July 14, 2011 19:12
Show Gist options
  • Save asimjalis/1083188 to your computer and use it in GitHub Desktop.
Save asimjalis/1083188 to your computer and use it in GitHub Desktop.
How to call clojure.contrib.shell-out/sh with timeout
(use '[clojure.contrib.shell-out :only [sh]])
(defn sh-timeout [timeout-in-seconds & args]
(.get
(future-call #(apply sh args))
timeout-in-seconds
(java.util.concurrent.TimeUnit/SECONDS)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment