Shell – Object oriented Unix shell with at least LINQ capabilities

shell

Well, "at least" is rather — it would be perfect 😉 There is similar question — Object-oriented shell for *nix . For me similarity with bash is no issue.

I would like to have some simple OOP plus LINQ. For now I am only aware of http://www.scsh.net/ but because of the syntax is a bit overkill.

Maybe I will show you by example what I mean:

run("ls ./").foreach(it => println(it.filesize))

or

run("find -r *.jpg") \
 .filter(it => it.datetime<today.adddays(-2)) \
 .foreach(it => run("gimp ${it.filename}"))

Is there anything closer to this "dream shell" than scsh?

Why am I asking? Because the more programs I write, the more I am drifting towards functional languages (C++ -> C#+LINQ -> Scala -?-> Clojure), and when yesterday I had to write simple find+print loop in bash it was painful. A man gets easily spoiled with all functional stuff ;-D.

Best Answer

rush seems similar, e.g. allowing you to write

processes.filter(:cmdline => /mongrel_rails/).kill

or

myproj['**/*.rb'].search(/^\s*class/).lines.size

but it looks rather dead. In the end, I'd go with just using some scripting language for shell tasks (instead of the other way 'round), for example as explained in "Using Python to create UNIX command line tools".

(Edit there's also a object-oriented shell in active development, albeit differing a lot from rushs concept, oh.)

Edit2 Just stumbled upon pbs, a Python wrapper making the use of Python for shell-like tasks more direct.

Related Question