Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is most common way of shell scripting in Clojure?

Tags:

shell

clojure

I found great examples of what Im looking for here : http://hugoduncan.org/post/2010/shell_scripting_in_clojure_with_pallet.xhtml

But seems like this "Pallet" is not what it was earlier... it says "Pallet is platform for agile and programmatic automation of infrastructure in the cloud, on server racks or directly on virtual machines. Pallet provides cloud provider and operating system independence, and allows for an unprecedented level of customization." - it's not what I want. I need just shell scripting.

Is there something alike in Clojure?

like image 526
cnd Avatar asked Apr 02 '12 10:04

cnd


2 Answers

The part of Pallet that translates clojure s-expressions into shell script is called Stevedore and it is available as a separate library: https://github.com/pallet/stevedore

Documentation on both Pallet and Stevedore on the Pallet website might not always be complete or accurate (the docs are a bit behind current code), so it might require a bit of puzzling.

Out of curiosity, what kind of shell scripting would you like to do in Clojure?

like image 65
Gert Avatar answered Nov 06 '22 18:11

Gert


If Stevedore seems overkill for your particular case you can make simple clojure scripts and run them like any shell scripts using 'lein-exec' Leiningen plug-in.

http://www.unexpected-vortices.com/clojure/brief-beginners-guide/standalone-scripts.html

like image 40
hannesh Avatar answered Nov 06 '22 17:11

hannesh