John wrote:
> I did this:
>
> (import '(java.io BufferedReader InputStreamReader))
>
> (defn cmd [p] (.. Runtime getRuntime (exec (str p
>
> (defn cmdout [o]
> (let [r (BufferedReader.
> (.InputStreamReader.
>(.getInputStream o)))]
> (dorun (map println (line
I did this:
(import '(java.io BufferedReader InputStreamReader))
(defn cmd [p] (.. Runtime getRuntime (exec (str p
(defn cmdout [o]
(let [r (BufferedReader.
(.InputStreamReader.
(.getInputStream o)))]
(dorun (map println (line-seq r)
Then:
(cmdout (cm
Launching shell commands from Java is a nuisance. Commons Exec helps
a little bit:
http://commons.apache.org/exec/
-Stuart Sierra
On Aug 25, 8:00 am, Parth Malwankar <[EMAIL PROTECTED]> wrote:
> I want to run a shell command through Clojure
> so I tried the following which doesn't work:
>
> user
On Aug 25, 5:45 pm, "[EMAIL PROTECTED]"
<[EMAIL PROTECTED]> wrote:
> Here's one I wrote probably needs revisited
>
> (defn doCmd
> "do any command"
> ([& params]
> (let [cmd (new java.util.ArrayList)]
> (doseq atom params
>
Here's one I wrote probably needs revisited
(defn doCmd
"do any command"
([& params]
(let [cmd (new java.util.ArrayList)]
(doseq atom params
(let [#^String prms (. atom split " ")]
On Aug 25, 10:00 pm, Parth Malwankar <[EMAIL PROTECTED]>
wrote:
> I want to run a shell command through Clojure
> so I tried the following which doesn't work:
>
> user=> (.. Runtime (getRuntime) (exec "vim"))
> [EMAIL PROTECTED]
> user=> (.. Runtime (getRuntime) (exec "/usr/bin/vim"))
> [EMAIL PRO
Hi Parth,
On 8/25/08, Parth Malwankar <[EMAIL PROTECTED]> wrote:
>
> I want to run a shell command through Clojure
> so I tried the following which doesn't work:
>
By "doesn't work" do you mean that you don't see any output from the processes?
First thing to understand is that processes creat
I want to run a shell command through Clojure
so I tried the following which doesn't work:
user=> (.. Runtime (getRuntime) (exec "vim"))
[EMAIL PROTECTED]
user=> (.. Runtime (getRuntime) (exec "/usr/bin/vim"))
[EMAIL PROTECTED]
user=> (.. Runtime (getRuntime) (exec "ls"))
[EMAIL PROTECTED]
I may