Slashdot is powered by your submissions, so send in your scoop

 



Forgot your password?
typodupeerror
×
Windows Operating Systems Software IT

Next-gen Windows Command Line Shell Now in Beta 668

Suddenly_Dead writes "Microsoft's new command line shell, MSH or Monad, has entered the beta phase. Channel9 Wiki has information on how to download this (complete with Guest ID), and other related info."
This discussion has been archived. No new comments can be posted.

Next-gen Windows Command Line Shell Now in Beta

Comments Filter:
  • monad (Score:5, Interesting)

    by yakumo.unr ( 833476 ) on Sunday June 19, 2005 @12:10PM (#12856439) Homepage
    It is , I beleive, the fist object oriented shell.

    All the others use strings for piping.

    Most *nix users i've seen writing online that tried it for a good while to really get used to it thoguht it was really good.
  • One Perl (Score:4, Interesting)

    by Doc Ruby ( 173196 ) on Sunday June 19, 2005 @12:16PM (#12856482) Homepage Journal
    What's wrong with just running the Perl debugger, for an interactive shell? If the *nix shells were as limited in their reach into the OS APIs as the Windows commandline UIs have been, I'd use "perl -de 1" instead of bash or sh. As it is, I use that Perl shell for most commandline programming, especially for any data processing tasks. And a Perl shell has thousands of existing scripts, most of which work on Windows as well as any other platform, and are easily customized to script Windows apps. Even more, the Perl platform has lots of modules that embed programmable clients to Windows apps into scripts, and lots of scripts that bundle them together. Why not use old all-encompassing Perl, rather than the new, strictly limited Monad?
  • by Kafteinn ( 542563 ) on Sunday June 19, 2005 @12:22PM (#12856517) Homepage Journal
    The question is, who would really be interested in it at all?
    The more power to the user the more power to botnet controllers!

    One spyware infested crazy windows zombie machine botnet to rule them all!

    Microsoft will continue to make unsecure software but this time with a way for the botnet controllers to actually do something with the botnets.
  • Re: No Thanks (Score:4, Interesting)

    by Nimrangul ( 599578 ) on Sunday June 19, 2005 @12:24PM (#12856531) Journal
    Why is everyone immediately saying cygwin? Windows Services for Unix is the official release of ksh for Windows.
  • Re:whoosh! (Score:5, Interesting)

    by SnprBoB86 ( 576143 ) on Sunday June 19, 2005 @12:37PM (#12856600) Homepage
    All of these little "tools", Microsoft is providing. Take a look at the samples for MSH and you will that the commands are heavily inspired by Unix.

    This tools are "commandlets." Being able to pipe .Net objects into mini applications with the full .NET framework available for use will be increadably useful.

    I can see MSH being a HUGE improvment over Bash. For example:

    MSH> get-process

    (IMAGINE A PROCESS LIST HERE, OR SEE THE LINK... damn /. junk filter)

    Want to filter that by virtual memory consuption?

    MSH> get-process | where { $_.virtualmemorysize -gt 150000000}

    (IMAGINE A PROCESS LIST HERE, OR SEE THE LINK... damn /. junk filter)

    In Unix, you have to parse string output and all sorts of bullshit in order to access a data field of some conceptual object, but with MSH I will be able to simply access it directly in a type-safe way. That is a huge improvement.

    See more here: http://weblog.infoworld.com/udell/2004/11/02.html
  • Re:whoosh! (Score:4, Interesting)

    by diegocgteleline.es ( 653730 ) on Sunday June 19, 2005 @12:43PM (#12856635)
    The Unix shell is the implementation of the Unix philosophy of small parts working together. It's the antithsesis of Windows' philosophy of providing everything possible through DLLs distributed with the OS.

    It's just me, or you just said the same thing twice?

    Unix has a lot of command-line tools, but it also has tons of libraries with no commandline attached to them.

    There's nothing wrong with the Microsoft's DLL aproach either, they just have to provide a command line for the DLLs they want, programs which will happen to parse the command-line switches and pipes and use the DLLs to execute the real job. It's in fact a "perfect" policy/mechanism balance. Many unix command-line tools don't provide a library to be used by programs, very often I wish they would.
  • why not cygwin? (Score:1, Interesting)

    by bokmann ( 323771 ) on Sunday June 19, 2005 @01:04PM (#12856734) Homepage
    If Microsoft wasn't so arrogant / sufferring from 'not invented here' / needing to own every aspect of the OS so they can figure out new and innovative ways to exploit it once you rely on it, they could just include cygwin and a shell like bash.

    Cygwin/bash is there, does everything people want out out of a shell, is under a license that would allow Microsoft to redistribute it, and Microsoft might get some positive points from the geek crowd.
  • Re:whoosh! (Score:5, Interesting)

    by ArbitraryConstant ( 763964 ) on Sunday June 19, 2005 @01:29PM (#12856860) Homepage
    " And all of that will require processing power. All of those objects have to be converted each and every time they get passed. Even the conversion to text will take cycles."

    Are you kidding? Parsing text is one of the hardest things for a modern processor to do. Having fields available in a consistent internal representation allows you to do stuff based on them without having to parse anything, and you don't have to parse things. How many regexen do you write in a typical shell script? I'm not saying there are no disadvantages to Microsoft's way, but speed isn't one of them.

    Also, you don't have to launch so many processes with MSH way. *nix shells can be prohibitively slow if you use an iteration strategy that results in lots of processes being launched, but sometimes it's hard to set things up as a pipe because you often have to do more complex parsing.

    These things aren't so much of a disadvantage for larger programs that often end up in another language, but small one-time scripts will probably be easier.

    I'm not going to use Windows, but if someone can come up with something better than that stupid Python shell replacement on UNIX I'll give it a shot.

    Actually it seems to me that new tools for the current shells could serialize objects and pass them through the pipes we have.
  • Re:One Perl (Score:3, Interesting)

    by Doc Ruby ( 173196 ) on Sunday June 19, 2005 @01:31PM (#12856868) Homepage Journal
    Microsoft ("they?") doesn't own Perl - and they don't have to. I can install Perl on a Windows machine without Microsoft having anything to do with it. The idea that a sysadmin tool has to be owned by the owner of the OS is crazy, but certainly consistent with the "Papa Microsoft" monopoly mindset.

    In fact, I wonder why we don't see more "Windows Distros". Bundles of Windows with preconfigured app/content packages. We see some insignificant bundles by computer retailers, like Dell, which include other apps with Windows. But those bundles are to sell computers. How come I don't see Windows upgrade licenses bundled with, say, an OpenOffice.org package, preconfigured to work right? Is there something in the Windows reseller license which requires that only Microsoft can bundle? Or just something in the Windows marketing agenda that prevents them from allowing those kinds of deals? Or merely apathy, and the monopoly mindset that prevents entrepreneurs from reselling Windows OS products bundled with non-MS apps?
  • Re:backslashes (Score:3, Interesting)

    by slavemowgli ( 585321 ) on Sunday June 19, 2005 @01:34PM (#12856877) Homepage
    If it ain't broken, don't fix it. Is there a *reason* why they used backslashes instead of forward slashes, historically? Or did they just do it for the sake of being different (which, in this case, is just a polite word for "incompatible")?

    I'm not sure if going back to forward slash usage now would be a good idea, but variety isn't *always* a good thing. Some things are standard for a reason.
  • Re:If it's good.... (Score:5, Interesting)

    by IamTheRealMike ( 537420 ) on Sunday June 19, 2005 @01:49PM (#12856937)
    That would be hard, MSH leverages .NET quite extensively. You might see a Mono Shell, or a Python Shell using the same concepts though.

    It's rather sad to see people dismissing this so quickly. I can guarantee if this was an Objective-C based shell from Apple people would be slobbering all over it by now, and saying how innovative Apple were, probably with some jabs at Linux too. I remember seeing an initial presentation about MSH a while back and the thinking behind it impressed me then, I'll be keen to try this when it's fully released.

  • by The Cookie Monster ( 129545 ) on Sunday June 19, 2005 @02:14PM (#12857050)
    They implement some subset that's good enough for the job at hand and tweak it when it screws up
    You're right on the money, but it hasn't worked well for decades, it's meant new changes can't be introduced to the system as everythings breaks.

    So when you ask "why does it do it that way?", the answer often starts with a description of how computers used to be used 30 years ago.
  • by cahiha ( 873942 ) on Sunday June 19, 2005 @02:18PM (#12857061)
    Microsoft programmers should look up "second system effect": they keep making the same mistake again and again.

    If you want to see some good (or at least interesting) directions people have taken shells into, there are Plan 9 rc (same idea as sh, but cleaned up), fish (better interactive features), and Tcl/Tk (shell-like programming for a full scripting language, including the ability to embed Java and C#/CLR objects). And if you want a full scripting language, Perl, Python, and Ruby fit the bill.

    A note to FOSS programmers: if you are really itching to clone Monad, please do yourself and everybody else a favor, implement your clone in Perl or Python: a Monad-like shell becomes almost trivial in those languages because they have all the reflection capabilities you need, and because they already have all the hookups to Java, C#, and COM that you might want.
  • Re: No Thanks (Score:2, Interesting)

    by callipygian-showsyst ( 631222 ) on Sunday June 19, 2005 @02:20PM (#12857075) Homepage
    and Microsoft has their own product, free download, called "SFU -- Services for Unix" that gives you a ksh shell and all the Un*x utilities." We actually stopped running BSD here and started running XP with SFU (and Cygwin) because it's a better desktop Un*x than the real thing.
  • by Zancarius ( 414244 ) on Sunday June 19, 2005 @02:24PM (#12857095) Homepage Journal
    Why do the unix zealots always dismiss ANY attempt to make the user experience more high-level / semantic-oriented (especially if it comes from Microsoft) ?

    Extracting the Microsoft-centric marketing jargon from your post (computing isn't a job, it's an experience!) so that I can get to the meat of the issue might be a bit difficult but here goes.

    For about ten years since the dawn of Windows 95, Microsoft has spent a fortune downplaying the power of a CLI in favor of the all-powerful GUI. After all, why is it that cmd.exe and family are so incredibly anemic? There is no clear way to interface with the system, such as with kill -SIG PID (granted, this is because Windows is void of a kill binary); the intent behind this is likely the design philosophy of Windows. Everything must interact with the GUI, leaving only limited functionality to the shell.

    So the upshot is that Microsoft is taking a step forward by moving a few steps back. Now that they're implementing a shell with something vaguely resembling real scripting, they have to somehow correct all of the marketing they have done over the years to mitigate the impact a lack of any decent shell in their operating systems. I know what will happen, too--Windows zealots will praise Microsoft for inventing the shell... never mind the fact that scriptable shells are older than I am.

    Now for my next question. Why do you seem to believe this is innovative? The notion of a shell that interfaces with the system by way of core userland utilities (ps, ls, kill, et al) has been around since the inception of Unix. The fact that Microsoft has just now caught on to the usefulness of a powerful CLI is nothing innovative. Like the topmost post suggested, perhaps they are reinventing Unix--poorly. Perhaps, too, they should save themselves the headache and scrap the entire Windows source and start with something covered by a BSD license. They left the copyright in ftp.exe, after all--why not borrow the rest of the system?

    Ultimately, I think MSH is just going to be a rotten hack, hyped up by Windows administrators who probably have no real understanding of what a powerful CLI can do. The shell is one thing--but what about all the other userland binaries that really make the shell useful? All the scriptable support in the world isn't going to save them no matter how bash-like it is--because without simple commands that can interact with running processes, the file system, and generally everything else (not those implemented within the shell, but ENTIRELY SEPARATE, which I don't think MS will do since they have a strange affinity for monolithic applications) what good is it really? Or is this innovation in the traditional Microsoft-marketing-department sense, where innovation is the capacity to strip all usefulness from an application to limit potential confusion, thereby increasing the end user's experience in a positive, fluffy-bunny environment?

    </rant>
  • Quick Tour of Monad (Score:5, Interesting)

    by SteveX ( 5640 ) on Sunday June 19, 2005 @02:32PM (#12857153) Homepage
    I wrote a short article on Monad [stevex.org] as well.

    Very cool shell; if you don't know anything about it, don't assume it's just a bash or ksh clone.. it's actually something fairly unique.

  • Re:If it's good.... (Score:4, Interesting)

    by mi ( 197448 ) <slashdot-2017q4@virtual-estates.net> on Sunday June 19, 2005 @02:58PM (#12857265) Homepage Journal
    It's rather sad to see people dismissing this so quickly.
    That's the weakness of the Microsoft brand. Whatever they do is usually designed poorly. Even when the design is Ok, the implementation is bad. Even if properly implemented, the thing will be crippled by several of -- at least -- the following:
    • having to support legacy concepts (such as drive letters);
    • licensing concerns (like XP workstation allowing only one user at a time);
    • wide-spread security concerns resulting in the feature being turned off by default on most installations;
    • wide-spread fears of accidental and intentional incompatability;
    • being only available as part of an expensive (and extensive!) upgrade;
    • etc.

    Their bad (as in both -- nasty and foolish) ways of doing things are catching up with them all the time.

  • Re: No Thanks (Score:3, Interesting)

    by X0563511 ( 793323 ) * on Sunday June 19, 2005 @03:46PM (#12857495) Homepage Journal
    I think this is going to be the next big bug. IE move over.

    Really, it's new territory for them, they have a poor track record, and this has "lots of hooks into the Windows kernel and various low level functions". Sounds dangerous.
  • Re: No Thanks (Score:3, Interesting)

    by julesh ( 229690 ) on Sunday June 19, 2005 @04:12PM (#12857621)
    It's basically just a way to interact with your file system... Monad is a big step ahead for windows...

    Talk about proving the quote right.

    That's all bash is. That's all it does in linux too


    The problem is, UNIX is built around an "everything's a file" abstraction, so having a file-based CLI works wonderfully for it. Windows doesn't really support that abstraction nearly as well, so for many essential system tasks you need non-file-based interfaces. MS have been starting to provide these with tools like netsh, but they're not there yet. This is what monad is supposed to address.
  • by Gorath99 ( 746654 ) on Sunday June 19, 2005 @04:48PM (#12857847)
    Actually, if you're using WSH and not batch files (and there's no reason why you shouldn't on win2000 and up), the scripting really isn't that bad. In fact, it's much nicer than scripting in bash with its awful syntax and near-inability to cope with data containing spaces. Damn powerful too as long as your apps expose meaningful DCOM objects. (Most MS apps do nowadays.)

    I still script quite a bit in bash, since it's simply more portable, but scripting in Windows really isn't all that painful anymore.
  • Re: No Thanks (Score:3, Interesting)

    by Osty ( 16825 ) on Sunday June 19, 2005 @06:54PM (#12858665)

    Wow, that sounds much easier than the UNIX way....

    Nobody said it was easier than the UNIX way, though for day-to-day operations it shouldn't be any more difficult. Where you'd find yourself writing a bash, perl, or python script in *nix, you'd write a msh script in Monad. Where you'd find yourself needing to write an actual application to do some work (think ps or grep), you'd write a cmdlet as a .NET assembly (or even write another msh script). The difference is in how much more powerful MSH scripting is because it pipelines objects rather than arbitrary strings. As has already been pointed out, you don't have to rely on awk or cut to parse out fields you care about (assuming they're even there -- you can't write a generic awk or cut script for various input, because the fields may be different across your different input streams). As well, because these are objects being pipelined, you can run methods on them directly.

    Take the example of killing a certain process (let's ignore the killall app for now). In *nix shell scripting, you have to call ps, then parse the output with something like awk to match the right process name and retrieve the pid, and then run kill with that pid. You can't make the processing chain generic, because ps gives you different fields in different orders depending on the options you provide. In Monad, you call get-process (which is aliased as ps), filter the output with where-object (aliased as where) to find the $_.ProcessName -eq "your process", and call the resulting object's Kill method. In such a trivial example, there's no reason to make the processing chain generic, but you could write a function that takes a System.Diagnostics.Process object and does whatever it wants to it. Then you can use that function with anything that will give you a System.Diagnostics.Process object. It doesn't matter what the output looks like (by default, get-process displays Handles, Non-Paged Memory, Paged Memory, Working Set, Virtual Memory Size, CPU percentage, and Process Name, but there are many more properties and methods available to you), because you're getting the object, not the textual representation as you would in *nix.

    As many have already said: Those who do not understand Unix are condemned to reinvent it, poorly

    You assume they're trying to reinvent *nix, rather than build something better. The core idea of pipelining objects may not be unique, but it's a very powerful concept and it's something that *nix simply doesn't have right now. You can dismiss this all you like, that's fine. I'd suggest you at least take some time and play with the beta first, so that you can make a truly informed opinion before dismissing it entirely.

    As an example of the power of Monad, consider that a wget-like cmdlet has been written (get-url, not part of the basic set of cmdlets available with Monad, but it shouldn't be too hard to find the script on the beta newsgroups), in 40 lines of well-formatted script (ie, including empty lines, brackets on separate lines, etc -- compress it, and it's even less lines of code). It doesn't have all of the options of wget, but the capability is there, and it gives a good example of what you could do with a little bit of scripting. Now consider that Monad can easily transform output to xml, and you can use get-url, Monad's XML support, and a bit of pipelining to write an RSS reader in a trivially few lines of script. I'm not going to claim that python or perl couldn't do that just as well. That's not the point.

  • by rcamera ( 517595 ) on Sunday June 19, 2005 @08:50PM (#12859245) Homepage
    a shell scrip from 30 years ago MAY run on a current /bin/sh. i don't have my o'reilly unix in a nutshell with me right now (i keep it at work), but as i recall, there's a whole section titled 'obsolete commands'. these commands may not exist on a specific system. good luck getting your shell script to work when the commands within the script are invalid.
  • by chiok ( 858005 ) on Sunday June 19, 2005 @09:13PM (#12859379)
    Is there a way to get a 4DOS style history or something like bash's history-search-backward & history-search-forward? That might be a deal breaker for me if not.

    Also, the 4DOS wildcard rename feature has unfortunately not been adopted.

    What no tabs?!?

  • Re:First impressions (Score:3, Interesting)

    by leonard_chung ( 658100 ) on Sunday June 19, 2005 @09:48PM (#12859545) Homepage
    The intent behind the longer names is really for initial learning curve and scriptability.

    In Monad, if I know how to get processes using get-process, I now know the "get" verb. Since the convention is standardized, if I want the content of a file, get-content is a good bet for the right command.

    If I really don't know, I can do

    get-command -verb get

    to get a list of all of the commands that are getters.

    Compare this with ls and cat which are just brute memorization. And good luck with apropos.

    As people get better with Monad, it's expected that they'll switch to the Monad aliases for these functions (intuitively, get-alias for the list) for shorthand notation, or use Monad's autocompletion.

    The other benefit of longer names is that within scripts, people can use the longer forms to make scripts easier to read and understand.

    Leonard

  • Re:If it's good.... (Score:3, Interesting)

    by mi ( 197448 ) <slashdot-2017q4@virtual-estates.net> on Sunday June 19, 2005 @11:21PM (#12860004) Homepage Journal
    Whilst the UNIX style unified directory hierarchy is aesthetically pleasing to computer scientists, I've never been convinced that it's really more usable. On Windows, people can learn a few simple letter to concept mappings "A" is the floppy disk, "C" is the stuff inside the Computer, "D" is the cD-rom drive, "E" is their usbEE kEE. Obviously not all systems will be like that, but it's common enough. On UNIX systems the location of floppy disks, installed programs, mounted USB keys and so on tend to move around unpredictably.

    Sorry, this is just laughable. So, you, consider "D" to be easier to associate with a "cD-rom", than "/cdrom"? You are not even trying to justify the "A" for "floppy disk" :-)

    The reaction of computer scientists should be your guide. These people tend to know answers to questions, which you don't know enough to even ask.

    licensing concerns (like XP workstation allowing only one user at a time);
    I don't see how this would affect a command shell designed for personal use.
    Oh, that's easy. You named it yourself: "for personal use". To ensure, it is available for personal use only you may only be allowed to run a single instance of it, unless you purchase the server license. Or it may not be available to telnet sessions. Or something bizarre like that.
    Microsoft backport far more stuff than Linux vendors do
    They better... With sh, csh (or whatever Unix shell rocks your boat) you can do anything. It may not be pretty, but it will work. Witness configure-scripts. With cmd.exe you can't even pass all of your own arguments down (there is no equivalent of "$@") -- forget about procedures, loops, etc.
    The guys working on MSH have blogs, I read a few, and they seemed very sharp to me.
    Oh, I'm sure, there are plenty of smart individuals working for Microsoft. However, the firm's organization and its dirty unatoned past (and, likely, present) will continue to weight on the firm's products -- and their reputation -- for some time... And these -- the reputation and perception -- are the subject of the thread.

We are each entitled to our own opinion, but no one is entitled to his own facts. -- Patrick Moynihan

Working...