MSH (shell)

B

bearophileHUGS

M

Michael

This can be of little interest of some people here, but I think it can
be interesting enough to justify a post.

An article on the Microsoft Command Shell:
http://arstechnica.com/guides/other/msh.ars
(Its syntax is rather Python-like, but Py syntax seems better to me,
even taking into account that their purposes are a little different).

Other info:
http://en.wikipedia.org/wiki/MSH_(shell)

Something vaguely similar made with Python:
http://geophile.com/osh/index.html

Kamaelia's Axon Shell[*] is also very similar. An Axon scheduler runs as a
background thread to an IPython interpretor, allowing you to "launch"
Kamaelia components interactively, including both pipelines and Graphlines
of components.

[*] http://kamaelia.sourceforge.net/AxonShell.html

But then Kamaelia IS designed as a pipeline/graphline (1d,2d,n-d) system
from the ground up, so having a shell for it was a logical step :) ...

I suppose the difference between python and MSH is you don't need a separate
language, maybe a module or three, but you don't need to modify the
language :)



Michael.
 
P

Paddy

Thanks, I'm enjoying reading the article.
So far I noticed how their select functionality is similar to our
comprehensions, but can also take a statement block. ( no wars please
;-).

I liked the tabular output format for lists of similar items, with the
automatic headings being displayed, e.g:
msh> get-childitem | select name, extension, {
if ($_.LastWriteTime.year -lt 2004) { "old file" }
else { "new file" }
}

Name Extension if
($_.LastWriteTime.year...
---- ---------
-------------------------
examples.txt .txt new file
output1.html .html old file
output2.html .html old file
somefile.doc .doc new file


I tend to avoid xml but their xml example below was succinct and
relatively painless. Do python libraries allow a similarly readable
version of their:

msh> $x = [xml]"<zoo><animal
kind='monkey'><name>Albert</name></animal></zoo>"
msh> $x.zoo.animal

kind name
---- ----
monkey Albert

Their "Extract the title and author elements from every item in the
rss.channel tag" example is also impressive.

Looks like an innovative new shell.

- Paddy.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,269
Messages
2,571,338
Members
48,025
Latest member
Rigor4

Latest Threads

Top