The `clojure` command just loads your script – it doesn’t call -main – if you had
;; test.clj
(println “Loaded!”)
And you ran `clojure test.clj` then it would print Loaded!
So you could do:
#!/usr/bin/env clojure
(println (str “Hello, “ (first *command-line-args*)))
(the clojure.main/main function binds the command line arguments to that var)
This works on OS X – I haven’t tried it on Linux.
Sean Corfield -- (970) FOR-SEAN -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
"If you're not annoying somebody, you're not really alive."
-- Margaret Atwood
> echo '(println "Yes!!!")' | time clojureClojure 1.9.0user=> Yes!!!niluser=>clojure 1.38s user 0.07s system 198% cpu 0.730 total
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
---
You received this message because you are subscribed to the Google Groups "Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscribe@googlegroups.com.
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clo...@googlegroups.com
Note that posts from new members are moderated - please be patient with your first post.
To unsubscribe from this group, send email to
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
---
You received this message because you are subscribed to the Google Groups "Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscribe@googlegroups.com.