Follow Slashdot blog updates by subscribing to our blog RSS feed

 



Forgot your password?
typodupeerror
×
Microsoft IT

A Guided Tour of the Microsoft Command Shell 519

jpkunst writes "Ryan Paul at Ars Technica provides an in-depth, 13 page review of the new Microsoft Command Shell (Monad). (The beta release can be downloaded for free from Microsoft.) From the conclusion: 'Despite my initial skepticism, I am deeply impressed with MSH technology, and I am legitimately excited about the future of the Windows command line.'"
This discussion has been archived. No new comments can be posted.

A Guided Tour of the Microsoft Command Shell

Comments Filter:
  • by mi ( 197448 ) <slashdot-2017q4@virtual-estates.net> on Monday October 24, 2005 @08:44AM (#13862974) Homepage Journal
    The "robust commercial applications and standard graphical utilities" are, indeed, in much need of reinvention. Oops.

    And what's with the "unleash" keyword? Do these people really think in terms, that glossy ads use to compare the advertised products with animals?

  • impressive (Score:4, Insightful)

    by Anonymous Coward on Monday October 24, 2005 @08:45AM (#13862984)
    Indeed, that MSH demo is impressive and all, but python is great too. System-wide integration? Big fucking deal:
    >>> import kudzu
    >>> kudzu.probe(kudzu.CLASS_HD, kudzu.BUS_IDE, kudzu.PROBE_ALL)
    [Desc: MAXTOR 6L040J2 Driver: ignore
    Device: hda , Desc: ST360021A
    Driver: ignore Device: hdc
    , Desc: Maxtor 6Y120P0 Driver: ignore
    Device: hde ]

    etc, and python is easily expandible to cover ALL the system. What makes MSH rock is that it's a python-like programming languaje PLUS a user-oriented (user=administrator) shell like bash. In linux we're used to program scripts with python, then pass the data through pipes to bash to do something with it. Crappy. When you have to do things like "command | cut -d ' ' -f 3 | cut -d ':' -f 1" to get some data, you know something is WRONG.

    The cool thing about MSH that its a SUBSTITUTE to bash/cmd.exe, not a "complement" like python is. Is not that bash or python are bad, but bash-like shells are 30-years-old unchanged technology. Fortunately, there're people writing user-oriented python-based shells, like http://ipython.scipy.org/ [scipy.org]
  • Some Wise Man Said (Score:4, Insightful)

    by R55 ( 601001 ) <ravi@in[ ].com ['dia' in gap]> on Monday October 24, 2005 @08:46AM (#13862987)
    Those who do not understand Unix are condemned to reinvent it, poorly.<br>
    -- Henry Spencer<br>
    Usenet signature, November 1987
  • by CyricZ ( 887944 ) on Monday October 24, 2005 @08:49AM (#13863006)
    Not only that, but consider the portion that says 'The Windows community is a universe of uniformity [...] and standard graphical utilities.'

    Indeed, we are seeing that that is not the case. Microsoft has gone out of their way to drastically alter their GUI, such that it looks nothing like the XP GUI, and thus nothing like the older GUI before that. Hardly a show of uniformity, if I do say so myself.

  • Re:impressive (Score:3, Insightful)

    by Anonymous Coward on Monday October 24, 2005 @08:57AM (#13863066)
    When you have to do things like "command | cut -d ' ' -f 3 | cut -d ':' -f 1" to get some data, you know something is WRONG.
    Yes. Either your command is wrong (it should do that formatting as its output) or you should have used [g]awk instead of cut.
  • by CastrTroy ( 595695 ) on Monday October 24, 2005 @08:58AM (#13863070)
    A shell is nice but, can you change all the settings from the command line? The fact that most of your settings are stored in the registry, makes things a lot harder to do from the command line. Sure you could probably change a key or two if you needed to. But you'd probably have to know the exact location. Browsing the settings, to find the key you want, would be a lot harder. Can you install most programs from the command line, and manage all your installed software from the command line. I like the fact that in Linux, most base system stuff is designed so that it can be done by the command line, first and foremost, I like the fact that Linux stores all the settings in text files. This means that you can change the setting with any text editor of your choice. Also, there is a huge library of tools available at the command line. Not just stuff that was thought up by the people who made your command line (bash, csh, zsh), but also anybody else who made just about any other utility.
  • by Dekortage ( 697532 ) on Monday October 24, 2005 @08:59AM (#13863078) Homepage

    Just a few days ago, there was another article on Slashdot [slashdot.org] about how Ballmer wants to "storm Linux." If they can convince *nix people that Windows has a powerful CLI, this will do much to suck them in... it is the "eye candy" for true geeks.

    The article author starts to say this himself: My biggest frustration with MSH is the low quality of the actual shell interface. On my Linux system, I am extremely dependent on line editing keyboard shortcuts that simplify manipulation and alteration of command line input. MSH has very few line editing shortcuts, and extremely limited support for tab completion.

    And I remember when CP/M [sysun.com] was all the rage... *sigh*

  • Marketing sucks (Score:3, Insightful)

    by Xarius ( 691264 ) on Monday October 24, 2005 @09:00AM (#13863094) Homepage
    Yet again Microsoft takes an age-old technology, like scalable icons or transparency, and turns it into the best thing since sliced bread? Shouldn't they be condemned for leaving it this long to release a tool as powerful as this, instead of praised?

    The best I can say is "It's about damn time".
  • ..C# (Score:5, Insightful)

    by jkind ( 922585 ) on Monday October 24, 2005 @09:02AM (#13863109) Homepage
    Well it looks like C# will be alive and well for some time to come. This article definitely had the feel of Jesse Liberty's Programming C# OReilly book.
    " MSH has a number of unique features that make it easy for users to leverage .NET technology at the command line. Type casting is an easy way to transform a simple core type into a .NET instance or another core type. To cast an instance into another type, simply place the name of the desired type in brackets right in front of the instance. You can change a string into a number with an int cast:
    msh> [int]"5" + 5
    10
    "
    is basically the section from the book on boxing and unboxing. Anyway, as a C# developer, it's great to see the language isn't dying..
  • Re:impressive (Score:5, Insightful)

    by NickFortune ( 613926 ) on Monday October 24, 2005 @09:05AM (#13863121) Homepage Journal
    When you have to do things like "command | cut -d ' ' -f 3 | cut -d ':' -f 1" to get some data, you know something is WRONG.

    Agreed. In this case it's the coder, who should really have enough nous to print the data in the format in which he intends to use it. That's hardly rocket science, is it?

    Of course, if you didn't write the python script and don't have the time and/or skill to hack it, you might nd up using cut and the like to get the data in the format you need. The cool think about that is that it's possible. I don't know if the same can be said under MSH, but it seems unlikely - the focus of Monad seems to be .NET integration, not a stream based filtering command line environment.

    Then again, maybe you didn't even write the wrapper script and don't understand anything. If so you can always troll slashdot as an AC and get some astroturfing in.

  • by Anonymous Coward on Monday October 24, 2005 @09:13AM (#13863159)
    So, what stops you from running in "CLASSIC" desktop explorer.exe shell usermode then?

    * :)

    (Nothing, correct? Just change the look of it IF the new look bothers you... it's always been this way in Microsoft OS' anyhow, thru XP/Server 2003 (which it defaults to anyhow on this version of the OS)).

    APK

    P.S.=> This SHOULD also be "doable" in Windows 'VISTA' builds as well, but I can't comment on it having used it first-hand (Windows Server 2003 user here, in workstation default install mode)...

    As far as this new "MONAD" shell?

    It will probably appeal greatly to those who are used to WSH/CSH scripting (using a VB-like model) no doubt!

    Personally/myself??

    I have always found that the std. cmd.exe command-interpreter shell is pretty powerful in combination with .reg file merges, its native commandset, & if needed? Microsoft's Resource Kit commandline tools, if not 3rd party ones you can find here:

    www.jsiinc.com

    By searching the keyword "freeware" there...

    There's not alot you cannot accomplish with those toolsets alone imo...

    Lastly/Worst comes to worst?

    Writing up a console/charactermode/terminal app is NOT a problem with languages like Borland Delphi if needed...

    (However, then you need to be more than just a network tech/administrator usually, & have "more serious coding skills" & understanding of the OS + the language tool you use in order to do this - most techs don't have that, & few admin types do)...apk
  • doing it for? (Score:5, Insightful)

    by sgt scrub ( 869860 ) <saintium@NOSpAM.yahoo.com> on Monday October 24, 2005 @09:22AM (#13863197)
    I didn't get very far into the article before they got to the "we do things for you" part. Maybe I'm alone in this belief but I absolutely hate it when a language/shell/application will do things for me.
    For instance (from the article):

    MSH features the typical data types found in most other modern languages: strings, integers, arrays, and hash tables. When you enter any of those kinds of values at the command line, MSH will echo them back.
    msh> "blah"
    blah
    msh> 5
    5
    By comparison, in the Bash shell, expressions are always treated as commands and the echo command must be called explicitly if the user wants to display a value at the command line.


    If I want an echo statement I WILL TYPE echo! I don't want the software to ASSUME (make and ass out of me) if I make a typo!
  • by CDPatten ( 907182 ) on Monday October 24, 2005 @09:39AM (#13863316) Homepage
    Hypothetically: What if MS pulls it off and puts out the best OS that the Linux guys have ever seen. Let's say it's the Longhorn Server, WinFS, Monad, and everything MS has been touting works. Remember this is a hypothetical here so save the flaming/trolling for another thread.

    Will the Linux guys at that point stop bashing MS? Will you consider using the MS OS? Now I understand you don't trust them, but how will you respond if you can't say their product sucks? Will the comments be, "Ya they make the best OS, but they are evil?" Or will you continue to say that "Windows is just crap because they don't share the kernel source?"

    We are starting to see more and more people say that MS is doing a good job (like the parent thread here), and much to my surprise they are starting to open up their formats and products a little (not completely I know, but moving towards that direction). By all accounts it looks like for the next 18 months MS will be releasing some decent software, most of it strides ahead of the OSS available. Not to say that MS isn't catching up to SOME open source products... but that's fine, they should add the best features to their product, why wouldn't they?

    Just an honest hypothetical here, I'm not trolling or anything, I'm trying to understand your stance a little better. The standard cliché response of "MS is a monopoly and EVIL" is fine, but I was hoping for more thought provoking responses.
  • by Hektor_Troy ( 262592 ) on Monday October 24, 2005 @09:53AM (#13863413)
    Wait wait .. so ... when Microsoft does something interesting (it happens) and it's remade in whatever OSS flavor of the month, that's cool.

    But if Microsoft remakes something interesting made by OSS it's stealing.

    I thought, in both cases, it was a matter of reverse engineering and clean room implementation.
  • hummm.... (Score:5, Insightful)

    by Vo0k ( 760020 ) on Monday October 24, 2005 @09:57AM (#13863436) Journal
    I'm on page 6 already and I must say I start liking msh more and more.
    It's completely un-microsoftish!
    - It's very easy to shoot yourself in the foot. Extremely easy - anything that is not a command is an expression that is evaluated, so a typo may pass unnoticed and without a warning.
    - It provides lots of sweet syntactic sugar making things easy and terse while not overly obscuring them.
    - It takes some of the best from lots of other languages. Shamelessly too. ($_, select, | etc)
    - It makes some evilly hack-friendly assumptions ("current instance" is the current directory)
    - It will likely suck as an interactive shell, but makes simple scripts to automate system tasks obscenely easy. Likely, no more repeating 1000 times "click add user, type username, type password twice, mark 'Password never expires', enter Groups, select 'staff', click 'add group', click OK, click OK".

    It really looks like the project was created by the programmers while the management was on vacations, then all the details hidden and managers just fed with marketspeech while programmers worked on a tool that would finally make THEIR OWN life easier, instead of just appealing to managers of customer companies and making programmers' life more painful.
  • by everphilski ( 877346 ) on Monday October 24, 2005 @10:05AM (#13863490) Journal
    The colors may have changed but the patterns are the same. The start button is at the bottom left hand corner. The taskbar spans the entire bottom of the screen. The three buttons on the upper right of any window are minimize, toggle fullscreen/windowed, and exit, respectively, in that order.

    That is what uniformity is. Changing colors / visual schema is not uniformity. That's like saying a green car is not uniform to a blue car. You can still drive it with the knowlege you learned in drivers ed.

    -everphilski-
  • Re:impressive (Score:2, Insightful)

    by ookaze ( 227977 ) on Monday October 24, 2005 @10:27AM (#13863635) Homepage
    What makes MSH rock is that it's a python-like programming languaje PLUS a user-oriented (user=administrator) shell like bash

    Perhaps that's interersting from the POV of the programmer, but from the POV of the sys admin, it's a nightmare.
    Those that don't understand Unix are bound to reimplement it, badly.
    Bash goes out of its ways to provide tools and syntax allowing you to remove all customizations others could have put in the environment. Korn shell compatible shells are lightweight and portable and cross-platform and respect a small standard. Lacking any of this means a shell is NOT like bash (or any other shell). So your premise is wrong for MSH. MSH does not have MOST of these power features of shells, so I don't understand how you can compare it to them.

    In linux we're used to program scripts with python

    I'm not. Who is this 'we' ?

    then pass the data through pipes to bash to do something with it. Crappy.

    This says it all. It is one of the most powerful feature of Unix, and you call it 'crappy'.
    Again, 'those that don't understand Unix ...'
    FYI, I saved several production data in real time in big french firms thanks to this crappy feature ...

    When you have to do things like "command | cut -d ' ' -f 3 | cut -d ':' -f 1" to get some data, you know something is WRONG

    Which, obviously here, is the person who has wrote this garbage. I would never write this, but would rather write a sed command to do that.

    The cool thing about MSH that its a SUBSTITUTE to bash/cmd.exe, not a "complement" like python is

    It sure is cool. csh was cool too. Look at what happened to it. Cool and Useful/Powerful are not the same.

    Is not that bash or python are bad

    Fortunately you have enough common sense to agree with that.

    but bash-like shells are 30-years-old unchanged technology

    Proven technology, what is wrong with that ?? FYI, people have tried to add cool things to the concept (csh types, zsh, ...). Bash is actually an evolution of sh/ksh, contrary to what you say. It's just more powerful.
    A shell must have, among its features, stability and security. 30 years old is a good thing when you want these. Given that MSH is developed by MS, and given their track record on these 2 points (stability, security), excuse me if I don't hold my breath on MSH.

    Fortunately, there're people writing user-oriented python-based shells, like http://ipython.scipy.org/ [scipy.org]

    User-oriented python-based shells, OMG !!
    Given the problems I've got till this day with Python apps (memory leaks, unexplained and untracable crashes), given the tedious work of migrating core systems based on Python (look at Gentoo), excuse me, but I think I will stay with bash for a long time.
  • Re:On The Pipe (Score:3, Insightful)

    by Haeleth ( 414428 ) on Monday October 24, 2005 @10:28AM (#13863641) Journal
    it is much harder to write simple general purpose filters for generic objects than for text data. There are quite a lot of general purpose tools in Unix, like grep, sed, tail, etc. that can operate on almost any form of data, whereas MSH tools need to operate on objects, which is quite a bit harder.

    If all objects have methods to serialise them to strings - and it doesn't seem unreasonable to assume that they will - then whenever you're fed an object you don't know about, you can access it as a string. At which point, bingo! you can use a general purpose filter for text data, just like in Unix.

    I may be wrong, but this does look to me like a technique that can degrade reasonably elegantly to the lowest-Unix-denominator for programs that don't make use of all the .NET stuff.
  • by cbreaker ( 561297 ) on Monday October 24, 2005 @10:48AM (#13863784) Journal
    Microsoft. It's closed source, as far as I can tell. Nobody can add the features you want, you have to beg Microsoft.

    As much as MSH *might* be good for it's other strengths, there's the possibility that it might never have good tab completion, code coloring, and other such things.

    That's the REAL reason OSS/Linux/Etc has taken off. The empowerment of being able to change the system to suit your needs, instead of altering your needs to suit the system.

    And in the end, people like sh/bash/etc. It's extremely easy for even a beginner to do practical things and produce functional scripts. It almost seems like MSH originally stood for "Microsoft Scripting Host" and the marketing department decided that it would be better to call it a shell to compete with Linux.
  • by LnxAddct ( 679316 ) <sgk25@drexel.edu> on Monday October 24, 2005 @10:49AM (#13863796)
    There are already quite a few shells in unix that follow a similar paradigm. Python's default shell comes pretty close, but there are off shoots of it that provide functionality designed to be used as a command shell. MSH is pretty much an interactive ruby shell or python shell designed to run regular commands and treat files like objects (which is as simple as defining a class that can interpret the file information and give it methods like .get_extension) The real key here is that I belive everything is treated as an object. With minor modifications to the python shell and maybe an additional class or two you would have the exact same functionality. You see... there is a reason though that noone has done this. System administrators should not have to learn the concepts of object orientation just to do their job. They are not programmers. Its bad enough when programmers design GUIs because they cater to programmers and not typical users. Monad caters to programmers and not system administrators. Most unix sys admin I know do know how to script in something like perl or python, but most windows admin are point and click or they can type a few commands into a file and rename it to .bat to run it. The monad shell has some great ideas for a shell used by and for programmers, but honestly it isn't a sys admins job to understand programming or programming paradigms. Let admins use simple bash like commands, even if it may not be the cleanest way, conceptually it is often easier, and let programmers script their way out of any hole they want.
    Regards,
    Steve
  • by Bobke ( 653185 ) on Monday October 24, 2005 @10:53AM (#13863824)
    While you are trying to be funny, you are correct,
    unix does need a shell like monad I'm afraid (hence ac)

    What monad will offer is something like

    >ls -l | head -n 10 | sort size | excel

    They are piping objects, we would need to do a lot of parsing to achief the same effect.

    Someone really needs to write a new shell for unix and abstract the unix system, by giving it knowledge of the common unix tools (parsing the output for the user), like ps, ls, sed, etc.

    Want to be famous ?
    Here is your idea.

  • by SilverspurG ( 844751 ) * on Monday October 24, 2005 @11:14AM (#13863990) Homepage Journal
    Everything is a .NET object, everything inherits from another object
    Between that line and the information that MSH will interface with other programs through ActiveX I can see a whole new world of exploits.
    What this means is they CAN make drastic changes down the road by simply changing a few objects
    And so can all the malware, spyware, crippleware, middleware, trojans, worms, viruses, and anyone with even a mild desire to make life difficult for people around them. I bet it'll be even easier to hide shadow processes on the system from the unwary user thus increasing Microsoft's ability to sell the world's desktop out to corporate marketing departments. Imagine banner ads, not in your browser, but legally (via click through EULAs) on your desktop. There's nothing you'll be able to do about it.

    Registry + ActiveX + a functional shell (finally) + .NET == cataclysmic user-base catastrophe waiting to happen

    Windows admins are screwed. Get out of IT now if you're still sane, get out even if you're long past sane. Life will become hell very soon.
  • by Anonymous Coward on Monday October 24, 2005 @11:19AM (#13864022)
    You need to meet more windows admins. Or get your head out of your ass, either or. You choose.
  • by SilverspurG ( 844751 ) on Monday October 24, 2005 @11:29AM (#13864102) Homepage Journal
    They're not piping objects to Excel. If you read the article you'd have read the part where they noted that interfacing with programs like IE and Excel will have to be done via ActiveX. Won't that be fun?
  • by SilverspurG ( 844751 ) on Monday October 24, 2005 @12:00PM (#13864391) Homepage Journal
    I bet the majority of the world would thank us if we'd go back to pen and paper and quit pushing computers at them all the time. You make a good suggestion.
  • by kuzb ( 724081 ) on Monday October 24, 2005 @12:15PM (#13864504)
    Don't you mean "It doesn't act like, SH, ZSH, Bash, etc... AND IT WAS MADE BY MICROSOFT, BUUUURN!"

    I really don't understand people like you. You whine, moan and complain because Microsoft's command prompt sucks, and when they fix it, you go out of your way to find new things to bitch about. What is very interesting, is that if they HAD copied Bash, or one of the other unix command lines, you would have immediatly jumped on them for that too.
  • What monad will offer is something like

    >ls -l | head -n 10 | sort size | excel

    They are piping objects, we would need to do a lot of parsing to achief the same effect.
    Just do : ls -l | sort | head -10 | tr -s " " "\t" > dir.txt; gnumeric dir.txt & After all, if you're going to be manipulating it in a spreadsheet, you probably want to save it in a file somewhere anyway, right?
  • Re:hummm.... (Score:3, Insightful)

    by leighklotz ( 192300 ) on Monday October 24, 2005 @01:09PM (#13864942) Homepage
    - It takes some of the best from lots of other languages.
    Syntactic sugar leads to cancer of the semicolon -- Al Perlis.

  • Re:doing it for? (Score:3, Insightful)

    by fzammett ( 255288 ) on Monday October 24, 2005 @01:16PM (#13864995) Homepage
    Ah, so, by extension you should be bitching about every shell that assumes I entered a command? Shouldn't I have to TELL IT to 'execute ls'? Why does it ASSUME that if I type ls I want to see a directory listing? Stupid shell, I hate them when they do things for me!

    And, you know, if a shell is going to make an assumption at all, I'd prefer it assume it's an expression than a command because if someone aliases ls with rm -fR, better it just echo that back then execute it, right?!?
  • Re:doing it for? (Score:3, Insightful)

    by memfrob ( 157990 ) on Monday October 24, 2005 @01:34PM (#13865130) Homepage
    Why does it ASSUME that if I type ls I want to see a directory listing?

    The GP isn't so much complaining about the assumption, but the arbitrariness of it. In most UNIX shells, everything you type at the prompt is a command. In MSH however, it appears that sometimes when you type something in, it might be a command, it might be a value, it might be a.... etc.

    msh> 5
    5

    Who's to say I don't have a command called '5'? What if it's not in the correct path? Or, for that matter, who's to say I don't have a command called '6' that I typo'd?

  • by SilverspurG ( 844751 ) on Monday October 24, 2005 @01:44PM (#13865200) Homepage Journal
    You've got that backwards. MIcrosoft hasn't implemented anything new. Everything that MS is doing is an idea that they've pirated from University students who didn't have the time or the resources to patent/copyright their ideas while they were writing their graduate theses. MS may have expanded it some or made the GUI a little more consistent but there's nothing new in the corporate world. The only reason why you don't see massive disputes between academia and MS is that the computing industry is relatively young and Universities weren't on the intellectual property bandwagon until fairly recently.
  • Re:impressive (Score:4, Insightful)

    by EvilNTUser ( 573674 ) on Monday October 24, 2005 @02:39PM (#13865643)

    "I'm just not seeing anything in here but a horribly tortured object oriented syntax and a reexpression of MS' nightmarish implementation of the common "--help"."

    The object oriented stuff provides extra features. You can still alias all the old stuff to the usual commands, and it apparently does so by default.

    "Considering the decades of command line functionality which sh type shells have, apparently MSH is only dreaming of what BASH can do."

    Please explain again how you think it's the shell's fault that other applications don't support its features. Oh and btw, `echo 'html-stuff' | firefox` results in a blank browser window.

  • by Proc6 ( 518858 ) on Monday October 24, 2005 @02:49PM (#13865701)
    Just do : ls -l | sort | head -10 | tr -s " " "\t" > dir.txt; gnumeric dir.txt & After all, if you're going to be manipulating it in a spreadsheet, you probably want to save it in a file somewhere anyway, right?

    Kick in the *NIX fanboi defense reflex: Offer a half-baked parallel and insist that any deficiencies are things you didn't need or shouldn't be doing in the first place.

  • by Vancorps ( 746090 ) on Monday October 24, 2005 @05:55PM (#13867021)
    Please come into the new millenium. If the registry gets corrupted due to a filesystem problem or a piece of malware you don't have to use it. You can either use a backup copy which Windows automatically generates for you or use a failsafe registry which will for all intents and purposes always get you back into Windows.

    This is the first time I've ever seen someone refer to a database as a single point of failure.

    Always good to see new things.
  • by owlstead ( 636356 ) on Monday October 24, 2005 @06:05PM (#13867081)
    They already got that one. Not that there is much in it. But it's there :)
  • by ScrewMaster ( 602015 ) on Monday October 24, 2005 @07:40PM (#13867654)
    The registry isn't exactly new ... Windows 3.1 had one, I believe. But it was a stupid idea from the start. I understand that Vista is going to be putting more "protections" in place to reduce registry abuse, but nevertheless like Windows File Protection it's just a hack on top of a hack.

    The only legitimate (and I'm using the term loosely) function that the Registry performs is to make it virtually impossible to move a major application from one machine to another without running the actual installation program. In effect, it's an intrinsic anti-piracy technique. Sometimes I think that's the only reason that it's still there.

The Tao is like a glob pattern: used but never used up. It is like the extern void: filled with infinite possibilities.

Working...