Stories
Slash Boxes
Comments

News for nerds, stuff that matters

Windows PowerShell in Action

Posted by samzenpus on Wed May 02, 2007 01:51 PM
from the read-all-about-it dept.
jlcopeland writes "For two decades I've hated the command prompt in DOS and Windows. Inconsistencies abound and everything is a special case. The fallback on a Microsoft box has been running a Unix shell under Cygwin or installing Microsoft's own Services for Unix (or its predecessor, Softway's Interix), or by scripting in Perl, but those only get you so far. Having co-written nine years worth of trade rag columns using mostly Perl as the implementation language for the samples, and thinking of every problem that comes across my desk as an excuse to write a little bit of scripting code, I've got some well-formed views about scripting languages and what works and what doesn't. That means I've been eagerly watching the development of PowerShell since it was called Monad. It's got the advantage of being a unified command-line interface and scripting language for Windows, even if it does have a dorky name." Read the rest of Jeffrey's review.
Windows PowerShell in Action
author Bruce Payette
pages 576
publisher Manning
rating 9
reviewer Jeffrey Copeland
ISBN 1932394907
summary Guide to PowerShell, the new Windows scripting language


Bruce Payette's Windows PowerShell in Action is a great overview of PowerShell, aimed at an audience that's got some experience with other scripting languages. Bruce's book is a big improvement over Andy Oakley's earlier book, Monad, which I had been using: it's more complete and it's up-to-date for the first release of PowerShell. It's got great (and sometimes amusing) examples, and feels like the Perl Camel book in flow. When I was reading it in the gym or someplace else away from the keyboard, I kept wanting to run back to the office to try something out. There are also useful "why it works this way" digressions, which provide a lot of context. Since Bruce was on the original development team, wrote most of the commandlets, and was responsible for much of the language design, those digressions are more authoratitive than the directors' commentary tracks on most DVDs.

In outline, the nine chapters in the first part of the book build up as you'd expect: overview and concepts, to data types, to operators, to regular expressions, to syntax, to functions, to interpreting errors. It covers that ground better than many language books that now litter my shelves. The explanations are clear, and the examples are almost all exactly on point. It took me a second reading to realize that my complaints about the regular expression sub-chapter wasn't about the chapter itself, but about some of the implementation decisions; that's an argument about style more than substance, and an observation about me, not about Bruce's writing or PowerShell. The first part of the book is the "mandatory reading," if you will, to get the language down and begin exploring on your own.

The second part is where the real applications are covered. That's the part that you especially want to read sitting next to the keyboard. As you'd expect, the example code is available from the publisher's web site to start you off — look for "Example Code" under "Resources." There's a very good discussion of text processing and how-to-handle XML, complete with some not-obvious warnings about traps to avoid. I've been working very carefully through the really good chapter on using GUIs with PowerShell, "Getting Fancy — .NET and WinForms," and my own proof of concept for that has been rebuilding an old C++ data entry application into a much simpler PowerShell script. As a nice side effect, Bruce's book (and the WinForms chapter in particular) provide a gentle overview to some concepts in the .NET framework, which I hadn't had an opportunity to delve into. The appendix on using PowerShell as a management application will be especially useful to system managers; that was one of the original PoweShell target audiences, and the language achieved that goal very well. The appendix on the language's grammar is really useful, and I keep flipping back to it to check on things.

After Oakley's Monad appeared, there was a long gap before the next PowerShell book appeared. Bruce's book looks to be the first of the post-release wave. If all it had going for it was the authoratative pedigree of the writer, it might be worth it, but it's also well-written, well-organized, and thorough, which I think makes it invaluable as both a learning tool and a reference.


You can purchase Windows PowerShell in Action from amazon.com. Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page.
This discussion has been archived. No new comments can be posted.
Display Options Threshold:
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
  • Monad (Score:5, Funny)

    Named after the designer lost a testicle in a tragic chair throwing accident.
  • PowerShell (Score:2, Interesting)

    by El Lobo (994537) on Wednesday May 02 2007, @01:59PM (#18960853)
    is one of the nicest things that came out of Redmond. Ever. My only complain is that it is tight integrated to .NET, but OTOH I believe this is necesary to integrate the always nice C# to it, which is of course a plus.... You can't have the cake and eat it...
    • Re:PowerShell by Jeremiah Cornelius (Score:2) Wednesday May 02 2007, @02:55PM
    • PowerShell by IpalindromeI (Score:3) Thursday May 03 2007, @08:46AM
    • 1 reply beneath your current threshold.
  • At this rate... (Score:5, Insightful)

    by pnuema (523776) on Wednesday May 02 2007, @02:00PM (#18960875)
    ...in 20 years MS will invent UNIX.
    • Re:At this rate... (Score:4, Informative)

      by JPriest (547211) on Wednesday May 02 2007, @02:12PM (#18961013)
      (http://lp.org/)
      For those that didn't get it, his comment was a play on the famous:
      "Those who do not understand Unix are condemned to reinvent it, poorly"
      [ Parent ]
    • Re:At this rate... (Score:4, Informative)

      by Shawn is an Asshole (845769) on Wednesday May 02 2007, @02:13PM (#18961027)
      You mean again [wikipedia.org]?
      [ Parent ]
    • Re:At this rate... (Score:4, Informative)

      by PhrostyMcByte (589271) <phrosty@gmail.com> on Wednesday May 02 2007, @02:19PM (#18961111)
      (http://www.int64.org/)

      Wake me up when *nix gets an object-oriented (rather than text-oriented) shell. Because that is what makes Powershell so unique. Yes, it has plenty of builtin functions to make tasks easier, but the real advantage is that everything you pass between commands is an object.

      You don't have to worry about interpreting text output - you just access whatever data you want directly. Many of the commands are easily chainable into something like "ls | select fullname,length | sort name | format-list | out-printer".

      [ Parent ]
      • Re:At this rate... by jimstapleton (Score:2) Wednesday May 02 2007, @02:35PM
      • Re:At this rate... by Anonymous Coward (Score:2) Wednesday May 02 2007, @02:37PM
      • Re:At this rate... (Score:4, Funny)

        by nanosquid (1074949) on Wednesday May 02 2007, @02:59PM (#18961825)
        Wake me up when *nix gets an object-oriented (rather than text-oriented) shell.

        "Far out in the uncharted backwaters of the unfashionable end of the Western Spiral arm of the Galaxy lies a small unregarded yellow sun. Orbiting this at a distance of roughly ninety-eight million miles is an utterly insignificant little blue-green planet whose ape-descended life forms are so amazingly primitive that they still think digital watches are a pretty neat idea." (Douglas Adams)
        [ Parent ]
      • Re:At this rate... by Nutria (Score:2) Wednesday May 02 2007, @04:12PM
      • An object-oriented shell for Linux by MS-06FZ (Score:2) Wednesday May 02 2007, @04:43PM
      • Re:At this rate... by vux984 (Score:2) Wednesday May 02 2007, @05:00PM
        • 1 reply beneath your current threshold.
      • Groovy by SuperKendall (Score:2) Wednesday May 02 2007, @05:25PM
      • Re:At this rate... by ucblockhead (Score:2) Wednesday May 02 2007, @05:40PM
      • PowerShell isn't a Shell It's a scripting language by Anonymous Coward (Score:2) Wednesday May 02 2007, @06:26PM
        • Re:PowerShell isn't a Shell It's a scripting langu by stimpy77 (Score:1) Wednesday May 02 2007, @11:37PM
          • Actually, that is PowerShells biggest weakness as a integration shell.

            The idea benind the Unix toolset and shell is that everything is reduced to a common lingo -- a character stream. Each tool can then be "used as designed", or "misused". The classic example is the original Unix spell implementation. The tool designer promises to accept as wide an input range as possible, to output consistent streams, and not be verbose.

            The actual use (misuse) to the tool is left to the shell and user.

            The Object philosophy means that input to a tool MUST have certain methods available. If the correct methods are not implemented over the object, an adaptor tool must be used. Microsoft ensures that all PowerShell tools work together IN NORMAL USE. Obvious "misuse" is not (necessarily) supported.

            This makes common usage cases easy, but makes "outrageous" cases almost impossible (unless you reach for VC++ and write your own adaptors).

            As an example -- I do a lot of "performance analysis", which entails examination of log files, conversion to normalized scales, and running the results through GNU Plot to get images to paste into reports. There is almost always a need for custom shell scripting to do the log examination and reduction.

            Now, this IS possible in PowerShell, but only by treating it as a "Unix (gasp, how horrible!)" type shell.

            Since the exploration phase (and creative "misuse") is my primary area, PowerShell doesn't have much to offer me. But, for a developer living in the straight and narrow land of "how it should work", it is probably the next best thing to sliced bread.

            As to the "PowerShell" equivalent of the non-Microsoft world: I find that I still (occasionally) cook up SNOBOL scripts. When writing compilers for an old course, it was the ONLY programming language specifically not allowed for assignments (it made lexing, parsing and generation much too simple).
            [ Parent ]
        • Re:PowerShell isn't a Shell It's a scripting langu by jonadab (Score:1) Thursday May 03 2007, @05:20AM
        • 1 reply beneath your current threshold.
      • Re:At this rate... by CrankyOldBastard (Score:2) Wednesday May 02 2007, @07:04PM
      • try "ls -s | lpr" by sethawoolley (Score:1) Wednesday May 02 2007, @09:50PM
      • Re:At this rate... by jlarocco (Score:2) Wednesday May 02 2007, @10:48PM
      • Re:At this rate... by jhol13 (Score:1) Thursday May 03 2007, @01:32AM
      • Re:At this rate... by fuliginous (Score:1) Thursday May 03 2007, @06:42AM
      • Re:At this rate... by CarpetShark (Score:2) Thursday May 03 2007, @06:52AM
      • Re:At this rate... by Jarth (Score:1) Thursday May 03 2007, @09:49AM
      • Re:At this rate... by PhrostyMcByte (Score:2) Wednesday May 02 2007, @02:53PM
        • Re:At this rate... by dAzED1 (Score:1) Wednesday May 02 2007, @05:28PM
        • Re:At this rate... by that this is not und (Score:1) Wednesday May 02 2007, @09:42PM
        • Re:At this rate... by ray-auch (Score:2) Wednesday May 02 2007, @03:44PM
        • Re:At this rate... by Tanktalus (Score:3) Wednesday May 02 2007, @04:22PM
          • Re:At this rate... (Score:4, Informative)

            by Thundersnatch (671481) on Wednesday May 02 2007, @04:38PM (#18963639)

            The FOR command [microsoft.com] in the "legacy" Windows shell is pretty powerful, too. It even has horrible syntax, just like its UNIX fathers.

            Yes, the legacy Windows shell sucks, but not as badly as most people assume. The NT shell can do a lot of stuff that most people don't even think to try. Great gobs of functionality have been added over the years, starting with Windows NT 3.5. And contrary to what many slashdotters think, the legacy shell on Windows NT-derived systems is not DOS, nor is it 16-bit. CMD.EXE is just another 32-bit or 64-bit process running on the NT kernel.

            [ Parent ]
          • Re:At this rate... by dwater (Score:2) Wednesday May 02 2007, @05:27PM
        • 1 reply beneath your current threshold.
      • Re:At this rate... by Jugalator (Score:2) Wednesday May 02 2007, @04:55PM
      • Re:At this rate... by renoX (Score:3) Wednesday May 02 2007, @04:58PM
      • Re:At this rate... by fitten (Score:1) Thursday May 03 2007, @09:05AM
      • 2 replies beneath your current threshold.
    • Re:At this rate... by morgan_greywolf (Score:2) Wednesday May 02 2007, @02:21PM
    • Re:At this rate... by misleb (Score:2) Wednesday May 02 2007, @02:31PM
      • Re:At this rate... (Score:5, Interesting)

        by archen (447353) on Wednesday May 02 2007, @02:54PM (#18961733)
        There's actually a lot of other cool things about it as well. I've been using Jscript to do stuff since Win2k (screw that VBscript garbage) but there are obvious limitations at the scripting level, but in the end you're always stuck in cmd.exe

        I was skeptical when I first heard about Monad. I mean it seemed obvious to me that Microsoft just didn't get the point of a "shell" which is supposed to be simple. With a pending install of Exchange 2007, the power shell is required so I figured I'd start to dig into it. I have to say I'm rather impressed.

        First of all, it is actually simple. Not only that, but the syntax is EXTREMELY CONSISTENT. And honestly I cannot stress that enough, because if you think you know part of a command you can usually figure out the verb/noun syntax to use. It also allows shortcut versions of commands so you don't have to type the entire "wordy" version of the command. Aliases are supported too. Another cool feature? You can navigate the registry like the rest of the file heirarchy.

        I'm a big fan of bash, but I must admit that at times it gets old shuffling stuff with awk and cut and so forth. By getting objects you can take what you want out of it, and not worry about the biggest Unix terror - the text output changing. If whatever you're trying to do doesn't support .net objects, you can still pipe text.

        Overall it's pretty awesome technology and I must give MS credit where it's due. Not that I'll be switching any of my FreeBSD servers to Windows because of it, but it makes windows administration orders of magnitude better. Too bad it got dumped in Vista. I've heard it will be included in service pack 1 though.
        [ Parent ]
      • Re:At this rate... by cduffy (Score:3) Wednesday May 02 2007, @03:00PM
      • Passing objects, huh? by aix tom (Score:1) Wednesday May 02 2007, @03:15PM
    • Re:At this rate... by fm6 (Score:2) Wednesday May 02 2007, @02:46PM
    • Re:At this rate... by The Lord of Chaos (Score:1) Wednesday May 02 2007, @03:05PM
    • Re:At this rate... by Bacon Bits (Score:2) Wednesday May 02 2007, @04:08PM
    • Re:At this rate... by JayClements (Score:1) Thursday May 03 2007, @08:18AM
    • 1 reply beneath your current threshold.
  • Don't knock it until you try it (Score:4, Interesting)

    by PhrostyMcByte (589271) <phrosty@gmail.com> on Wednesday May 02 2007, @02:03PM (#18960913)
    (http://www.int64.org/)

    Powershell is very powerful. Much more so than cmd.exe. I don't have significant enough experience with bash to compare the two but I would not be surprised to learn Powershell equals if not beats bash at the shell game. I wouldn't say it is ready to replace any of the scripting languages just yet.

    I have been using it for a while now and the single (semi-major) problem I can find is memory usage. It is a hog at best, and at worst when you are using it semi-heavily it can easily chew up 1GB of memory. That's even with giving the GC something to work with, ie unsetting $vars when you are done with their data.

  • Monads are windowless, get it? (Score:5, Interesting)

    by Brunellus (875635) on Wednesday May 02 2007, @02:05PM (#18960933)
    (http://ouij.livejournal.com/)

    I wish they'd kept "monad" as the name. It was a deft tip of the hat to Leibniz's Monadologie, which held that monads were the windowless metaphysical atoms of perception itself.

  • Well, *that's* unique (Score:5, Funny)

    by Angst Badger (8636) on Wednesday May 02 2007, @02:06PM (#18960951)
    Inconsistencies abound and everything is a special case.

    You should switch to bash and the GNU tools.

    Oh, wait.
  • by Anonymous Coward on Wednesday May 02 2007, @02:11PM (#18961007)
    Now all we need is for Sun to develop a Solaris-only shell, Apple to develop a Mac-only shell, and RedHat to develop a Linux-only shell. I hate re-using code because it forces me to solve new problems every day. I'd rather create new value on Mondays only, and then spend the rest of the week re-doing the same work on my other platforms. It gives my mind a chance to rest, and I can drink heavily mid-week and still be able to do my job.

    I sure hope they charge extra for it, make it a resource hog, lock out third-pary extensions, and then discontinue it as soon as I'm dependant on it. I really liked the 1980s and look forward to reliving them.
  • Great Review (Score:5, Interesting)

    by water-and-sewer (612923) on Wednesday May 02 2007, @02:14PM (#18961047)
    (http://www.therandymon.com/)
    I don't use Monad (:s/M/G/g) or intend to, so I don't care much about the book. But what a great review. We get a lot of amateur reviews around here, but this one was particularly well written, clear, and informative. Nice job, homie.
  • What is wrong with Cygwin? (Score:2, Interesting)

    by raphae (754310) on Wednesday May 02 2007, @02:20PM (#18961127)

    a Unix shell under Cygwin or [...] but those only get you so far



    What is wrong with Cygwin? How can he bash Cygwin (sorry, no pun intended) without even bothering to say anything about it?
  • Some clever spacing (Score:5, Funny)

    by Hoplite3 (671379) on Wednesday May 02 2007, @02:30PM (#18961265)
    Windows Powers Hell ?

    I guess I always suspected it was true, but the beastie mascot of BSD made me wonder if there wasn't room for a little UNIX in Hades too.
  • by 3m_w018 (1002627) on Wednesday May 02 2007, @02:31PM (#18961275)
    (http://www.dashmaps.com/)
    It's slower than cold molasses up a hill.

    It takes a few seconds for the prompt to appear, and if I run a "dir" operation with both cmd.exe and PS in a directory with hundreds of files, cmd.exe will beat it in seconds.

    I'm not running a slow machine(core duo 2, 1GB of RAM). Is there something that needs to be configured to make it suck less?
  • What about MKS? (Score:3, Informative)

    by markdj (691222) on Wednesday May 02 2007, @02:36PM (#18961331)
    You forgot MKS toolkit which has most if not all of the standard UNIX utilities along with vi, bash, ksh, sh, awk, sed, etc. What more could you want?
  • harry@satan:~$ apt-cache search powershell
    powershell - powerful terminal emulator for GNOME
  • I've been using this command-line since 1988, back when it was NDOS.COM, and was much better than COMMAND.COM. Later, they broke off from Norton and became JPSoft. When 2K came out, they changed the shell's name from 4DOS to 4NT.

    So, I've been using NDOS/4NT for almost 20 years now. Why would I bother to learn PowerShell when I already have a shell? And I already have cygwin, so I can use unix tools at the command-line just fine?

    It's sad that more people aren't using this great tool.

    • Ahhh, 4DOS by DragonHawk (Score:2) Wednesday May 02 2007, @09:37PM
  • A quick intro to Monad (Score:4, Interesting)

    by sootman (158191) on Wednesday May 02 2007, @03:04PM (#18961907)
    (Last Journal: Thursday July 12, @12:30PM)
    For those who haven never seen Monad in action and are quick to bash (ha! get it?) Microsoft's new shell, take a look at these two [msdn.com] videos [msdn.com]. You'll see that it's much more than just bash on Win32. In fact, if it ever catches on, it'll be Unix's turn to play catch-up, because some parts of it are pretty damn amazing. (Note that those are from 2005, but AFAIK, there haven't been substantial changes.)

    The whole point of Monad is that it's not just text, it's objects. So, unlike Unix, where you work with a command and then filter its output (which is just text), the output of Monad, while looking like text, is actually kind of like pointers back to the real thing, so instead of just doing a Unix-style command | filter | filter, you can say "OK, run this command, now of the things it output, go back and tell me this and this about them." Like, "Of these things that are running, tell me which five are using the most CPU time, then tell me the version of each, and how much memory they're using."

    PS: "...even if it does have a dorky name"--which name were you referring to: the one that sounds like 'testicle' or the one that makes me think of the Lottery? :-)
  • by Evilged (1096629) on Wednesday May 02 2007, @03:11PM (#18962035)
    I have to manage a Windows domain of a 1000+ users and Powershell (yes crap name) allows me to do stuff that you used to only easily do with expensive third party stuff quickly in a few lines.
    The only other choice to do something similar on Windows is VB script which I find painful at best. It may not be the best Shell ever but at the moment its the best Windows integrated shell with access to .Net, WMI etc. and it beats Active Directory administration through a GUI any day.
    The book is great by the way, and his blog has loads of useful tips too.
    Anybody who is actually going to try it, will find the powershell community extension very useful. G
  • by Brit_in_the_USA (936704) on Wednesday May 02 2007, @03:16PM (#18962159)
    I hope this is not a dupe - I certainly was not aware....
    ...PowerShell is avlaibel for MS OS's older than Vista too:

    http://www.microsoft.com/windowsserver2003/technol ogies/management/powershell/download.mspx [microsoft.com]
    • 1 reply beneath your current threshold.
  • Copy and Paste (Score:2)

    by tobiasly (524456) on Wednesday May 02 2007, @03:21PM (#18962245)
    (http://www.tobiasly.com/)
    The thing that absolutely drives me nuts about both the Windows Command Prompt and Power Shell is its inability to copy a multiline string to the clipboard as a single line. For example, when the output of a command wraps from one line to the next, trying to copy that output will leave that embedded newline intact.

    Even worse, all copy operations work on a rectangular block of text, not a true start and end point as in a word processor. It makes it useless for copying the output of a program (whether it be a long filename, URL, stack trace, etc.) and pasting it somewhere else.

    When PowerShell came out, that was the first thing I tried, thinking for certain they would have fixed that. But they didn't. At that point I closed PowerShell and haven't used it since; I just stick with Cygwin or use Putty to SSH into a *nix box.
  • Prompt (Score:1)

    by PenGun (794213) on Wednesday May 02 2007, @03:25PM (#18962321)
    (http://carnagepro.com/)
    Can the prompt be the present time ... like my bash prompt?
    • Re:Prompt by Evilged (Score:2) Wednesday May 02 2007, @03:39PM
      • Re:Prompt by PenGun (Score:1) Wednesday May 02 2007, @04:30PM
        • Re:Prompt by Evilged (Score:1) Wednesday May 02 2007, @05:08PM
          • Re:Prompt by PenGun (Score:1) Wednesday May 02 2007, @06:01PM
            • Re:Prompt by Evilged (Score:1) Thursday May 03 2007, @04:12AM
  • WSH since 1997? (Score:2)

    by timjdot (638909) * on Wednesday May 02 2007, @03:55PM (#18962853)
    (http://www.serviza.com/)

    Windows Scripting Host (WSH) was released in like what? 1997? How is PowerShell any different than what you could do with WSH?
  • Bean Shell (Score:4, Interesting)

    by hachete (473378) on Wednesday May 02 2007, @04:18PM (#18963271)
    (http://www.badstep.net/ | Last Journal: Tuesday December 30 2003, @06:04AM)
    The Bean Shell. That's it. That's what Gonad is trying to copy. Though I forget - who's trying to copy who this week?

    Same problems too as well - memory consumption up the wazoo and slow as hell. Every time you've got to do a "pipe" you need to look at miles and miles of API.
  • by Qbertino (265505) on Wednesday May 02 2007, @04:32PM (#18963523)
    Just reading the comments here emphasises what I think of todays state of IT: We are still in the steam age of computing. Wether what moves around in a CLI is streams of text or a bunch of objects doesn't really make a difference. Just today I was trying to get SuSE Linus to install mc over a remote ssh connection. [Sidenote to Windows-only people: Doing this sort of thing in the MS world still is factually impossible]
    Anyway I was there in SuSE CLI and fired up YaST 2 (MS speak: the SuSE Installer) in it's CLI version. And here it comes:
    1) The characters wouldn't render correctly because the charset wasn't the right one.
    2) I was logged in from OS X / Terminal and the keycodes from my Mac KB wouldn't reach out to remote PC SuSE with [fill in charset 'XXXX-uft8b32-centralusbekistany-ZZZZ' here] aktivated.
    3) A pure real literal high-quality unobscured 'Ctrl-C' tranferrend via the context-menue option of OS X term (smart people these apple guys) didn't work either due to SuSE/PC/Whatnot keycode/charset/whatnot issues

    I had to ask our Windows Admin next to me to log in via putty and to the install (duh.). Given, it was SuSE, it was 9.3 and it was totally bugged up. YaST 2 CLI sux and is no where near Debian apt or OS X Fink. [x86 Debian and OS X play ball very nicely btw. Great server/workstation combo]

    But as long as I have to spend 40 hours fixing character renderings of a web application the only possible way that isn't even mandatory according to w3c standards adn evaluation and as long as the VI is the only way to be halfway safe to work over remote ssh and then only if im using the right keyboard and have the right charset (of a set of something around 60) ... as long as we're actually still working this way and this way is the most effective possible (as mentioned earlyer, we are way out of Windows league here) - we are still in the early steam age of computing. I predict it will take another 20 for this crap to finally iron out and everyone is using Bash or ZShell, keycodes and charcodes and glyphs are all in line and everyone not using the standard gets fried by pure marketforce. Sort of like the automobile industry today. ... But as I said: IT still is in the steam age.
  • by Locutus (9039) on Wednesday May 02 2007, @04:54PM (#18963925)
    Why would this author not have put Windows in a VM on Linux years ago if it was that big of a deal? Sorry but that bit just sounded kinda strange but my guess it was all just to make it sound like he's a real programmer or something.

    LoB
     
  • Wow! (Score:1, Troll)

    by PhotoGuy (189467) on Wednesday May 02 2007, @05:07PM (#18964151)
    (http://slashdot.org/)
    Wow, so you're telling me that Vista not only has UAP (finally, an OS with fancy user permissions!), but also has a programmable shell!?!?!? WOW, I had no idea OS's had progressed so far. Wholy crap, sign me up!!!
    • Re:Wow! by Mia'cova (Score:2) Wednesday May 02 2007, @07:49PM
  • by MobyDisk (75490) on Wednesday May 02 2007, @06:44PM (#18965203)
    (http://www.mobydisk.com/)
    It woudl be nice if *nix commands offered standardized extensible input and output formats like what Powershell has with objects. Sysadmins write commands using pipes to connect processes together, then later when you upgrade the OS your scripts break because the format varies ever-so-slightly. Worse yet, without a standard error reporting mechanism nothing ever knows. The script can't tell "file1.txt 12345" from "error! 12345" so it just carries on with invalid data until somebody notices.
  • by Myria (562655) on Wednesday May 02 2007, @06:49PM (#18965257)
    I remember reading once that Monad requires all scripts to be signed by a key countersigned by a certificate authority. Is that still true? If so, Monad is completely useless.
  • effing objects (Score:2)

    by Tsiangkun (746511) on Wednesday May 02 2007, @07:54PM (#18965975)
    (http://www.soundclick.com/tsiangkun)
    Is there going to be an IDE for writing shell scripts now ?

    I for one like working with text, and could care less about wading through tons of API documentation for these wonderful pipable objects.

    I have a myriad of OO and procedural languages for solving problems. My shell is the duct tape that holds them all together.

  • by Bigon (881193) on Wednesday May 02 2007, @08:11PM (#18966153)
    you can use 'ls' in a shell!!!
    • 1 reply beneath your current threshold.
  • Documentation (Score:2)

    by atomicstrawberry (955148) on Wednesday May 02 2007, @08:12PM (#18966157)
    I tried running Powershell a while back after getting frustrated at how awful cmd.exe's scripting capabilities are in comparison to my usual environment (bash, in linux). It wasn't terrible, but I can't ever see it taking off. There's practically zero useful documentation to explain how to use the shell beyond the very basics. It also doesn't seem possible to get it to run older batch files (I have a few of them that are necessary for my job and I don't have time to rewrite them all), and I couldn't figure out how to set environment variables either. I'm sure that a lot of the things I was unable to get Powershell to do are actually very easy, but when there's no documentation available it might as well be impossible.
  • by LaissezFaire (582924) on Wednesday May 02 2007, @09:36PM (#18967003)
    (Last Journal: Tuesday February 25 2003, @02:24PM)
    My Windows Genuine Advantage must be broken. I tried to download powershell from the Microsoft site, but it said I needed to first validate my copy of windows. Maybe after I install powershell windows will remember one of the last two dozen times I validated my windows copy?
    • 1 reply beneath your current threshold.
  • Managing hundreds of remote servers (Score:3, Interesting)

    by mnmlst (599134) on Wednesday May 02 2007, @09:59PM (#18967207)
    (http://www.sysinternals.com/ | Last Journal: Saturday August 21 2004, @11:11AM)

    Thanks to some poor choices in my younger days, I have become a full-blown Microserf herding along 250 Windoze servers, half of them in remote locations. If I had it to do all over again, I would have taken the red pill. This may offend the *nix snobs here, but if MS gets really serious about MSH (the way I keep seeing it when running PowerShell), it will be awesome. I haven't seen anybody here mention that it is built-in with Exchange 2007 and when you run through an E2K7 wizard, the last step is the display of the MSH script that will execute once you click the Finish button. It's also just waiting for you to copy and paste that script before clicking the Finish button, so you can expand it and reuse it later.

    My boss is such a Windoze junkie, he pooh-poohs my scripting efforts at every turn. We often spend hours and hours doing repetitive crap in the GUI's because "we don't have time to work out a script now!". I have avoided getting really deep into cmd.exe and VBscript approaches ever since I first read about Monad during the betas as that crap should be passing away. I've been bursting at the seams for some good books to come out.

    Beware a first effort from MS. If they get serious, the third version will be quite good. In the meantime, a wise sage told me to expect third party vendors to jump on this bandwagon and cook up gobs of stuff to leverage the PowerShelll to save Win Sysadmins keyboard time with canned scripts. That would leave me sucking garbage in the MS Matrix with the rest of the Duracells, but fortunately my boss won't spend any money on decent tools, so I will get to hack out the scripts by hand and really learn MSH. Awesome.

    If you're a Win Sysadmin reading this, be sure to check out http://www.sysinternals.com/ [sysinternals.com]Sysinternals and download the Misc utilities package, especially pstools.exe I use them all the time like a telnet session (via RPC) into remote PC's to clear up networking problems on them. netsh.exe then allows me to remove freakin' static WINS and DNS entries in TCP/IP properties, all without disturbing the user. It doesn't take long to learn and it saves gobs of time.

    Now I need to get back to my Linux lessons so I can use some discrete Linux servers on our edge networks, then they can start appearing closer and closer to The Core.

  • I've played with PowerShell a little, and it looks very impressive from what I've seen. The thing that's prevented me most from using it properly, though, is the same thing that prevents me from using the old Windows Command Shell -- Windows presents it inside an awful, inflexible window. It's impossible to resize horizontally, only goes a limited distance vertically, and it's very difficult to customize.

    I'm sure there must be a way to use a Windows shell in a better terminal Window than that horrible thing that pops up by default, but I haven't been able to find anything yet. Can anyone suggest anything that's a bit more friendly for typing commands?

    My favourite command shell in Windows is still bash through a Cygwyn-compiled xterm, which is good, but I'd really like to try out the interactive part of PowerShell properly.

  • ruby shell (Score:2)

    by nighty5 (615965) on Wednesday May 02 2007, @11:51PM (#18968127)
    I'd love to see a rip off of this but with a ruby-ish type shell.... with the object orientated uniqueness....

  • by master_p (608214) on Thursday May 03 2007, @06:09AM (#18970215)
    It is very funny that the first programming language invented is the language that all other languages will eventually be turned to.

    Windows Powershell is nothing more than a functional programming language environment where function combination is the primary means of making calculations. So is bash and almost every other command line environment.

    Makefile tools are also mini functional programming languages. Make, ant, and other utils, are mini programming languages as well.

    But so are text config files: they hold instructions for programs to use to alter their behaviour.

    What about the hundred XML config files in various environments? And XML being used as a ultimate language for data transfers?

    How about XPath and XQuery? aren't those language environments, as well?

    Schema validators are also language environments.

    What about scripting languages for applications? Monad makes the whole .NET available at the command line, which means we can communicate with applications like Word and Excel not only using VBScript, but the whole .NET as well, from the command line.

    HTML and markup languages are ...programming languages as well. What about all the million communication protocols that exist out there?

    DON'T YOU SEE A REPEATING PATTERN?

    There needs to be a single language that unifies all these...that unifies data transfer between programs and machines.

    The funny thing is that...

    IT EXISTED FROM 1958!!!

    and it is called ...LISP.
  • by smchris (464899) on Thursday May 03 2007, @06:59AM (#18970497)
    "For two decades I've hated the command prompt in DOS and Windows. Inconsistencies abound and everything is a special case."

    Inconsistencies? Read "The Unix Hater's Handbook". It came with a barf bag pasted to the back inside cover. From that standpoint, it has been a blessing that the Windows shell has been a tiny subset of the UNIX shell.
  • Powershell DOS (Score:1)

    by DaveDerrick (1070132) on Thursday May 03 2007, @09:46AM (#18972495)
    Just downloaded & installed PowerShell. First command I tried was cd\ (I never type spaces), it would work under DOS, PowerShell didn't like it. Think I'll stick with DOS for now.
  • by hawkeye (4170) on Thursday May 03 2007, @10:52AM (#18973623)
    Powershell is powerful, but (IMO) anything that looks or feels like the old (and really crappy) cmd shell still needs some work.

    Let me first say that the whole .NET environment is fantastic. I especially like the apparent ease with which languages are integrated (IronPython, Boo). Powershell has good integration with .NET...I _really_ like the built-in XML parsing capabilities...a LOT!

    Other than still looking and feeling like a cmd shell, it doesn't support some of the common things that I use in a shell....all of the time: CTRL-U to clear the line before the cursor, or CRTL-E to go to the end of the line.
  • Image Magick tools run fine under windows in a pinch.
    [ Parent ]
  • by QCompson (675963) on Wednesday May 02 2007, @02:13PM (#18961021)

    given the current rate that Linux/Open source is catching up to MS, I give them another 10 years before linux has 20% of the PC market.

    2017, the year of the linux desktop!
    [ Parent ]
  • by PadRacerExtreme (1006033) on Wednesday May 02 2007, @02:14PM (#18961041)

    Things like the shell are decades behind unix.

    YOu do realize that 90% of users have aboslutely no need for a shell, right? I would argue most power users don't need a shell.

    [ Parent ]
    • Re:It's amazing people still use windows. by CastrTroy (Score:2) Wednesday May 02 2007, @02:37PM
    • Re:It's amazing people still use windows. by dknj (Score:2) Wednesday May 02 2007, @02:39PM
    • by Dr_Barnowl (709838) on Wednesday May 02 2007, @02:40PM (#18961431)
      I would argue most power users don't need a shell.

      I'd say that power users who think they don't need a shell don't know what they're missing ; they could have a lot more power.

      The gentleman sitting next to me has recently discovered and raves about WinGrep, a GUI file search/replace utility with RegExp support. It's not bad, but it can't compare with a shell - you can't, for instance, search for a bunch of files containing your desired pattern match and invoke an external utility to process each one. And anything that the original application designer didn't visualise as a feature is excluded. He's easily capable of comprehending grep and sed, which would do the same job for free, but he's more comfortable with the GUI.

      In a *nix style shell, the ability to pipeline STDOUT through a whole bunch of little utils is the tool of a real power user - and it has a nice easy learning curve, you can pick up new commands as and when you like, and combine them with old favourites. The downside to the *nix shell is that very often you have to perform some esoteric text processing to get what you want, which means learning tools like awk and sed. Powershell works by passing objects through the pipeline - objects that have useful properties. It's even an improvement with old-style executables that emit pure text - the .NET String object has an API that's a lot easier than sed and awk.

      The GUI equivalent of a shell for a power user would be a pipeline composer where you can take various widgets representing actions and plug them together. Perhaps something like the DTS transform designer in SQL Enterprise Manager. Or maybe not :-)
      [ Parent ]
    • Re:It's amazing people still use windows. by ArsonSmith (Score:3) Wednesday May 02 2007, @02:46PM
    • Re:It's amazing people still use windows. by Delkster (Score:1) Wednesday May 02 2007, @02:46PM
    • 2 replies beneath your current threshold.
  • by MightyMartian (840721) on Wednesday May 02 2007, @02:18PM (#18961097)
    (Last Journal: Tuesday March 13 2007, @02:39PM)
    Are we talking desktop or server here? In the server world, it's a different picture, and it's quite true that Microsoft has never had a command scripting language that was half as easy to use and as versatile as Bourne shell and its descendants. You can do a lot with NT batch scripting, but it's a tedious and horrid creature that leaves you with frequently incomprehensible scripts. It's nice to see that MS has recognized that, and finally recognized that good command line tools are an important part of a system administrator's bag of tricks. I cannot count the number of times I've wished for something like Bash that was integrated into Windows. Yes, you can use VBScript or JScript, but what little there is for file support is just plain hideous, and trying to work with standard input and output is just too clumsy to be really workable.
    [ Parent ]
  • by Ucklak (755284) on Wednesday May 02 2007, @02:21PM (#18961147)
    There was no competing OS when IBM chose to push it (DOS).

    Windows got it's push from 3rd party money (IBM and others) thus adding to it's war chest.

    Linux doesn't have the resources that Microsoft had to get it polished to the current level.
    [ Parent ]
  • Re:9 years? (Score:1, Funny)

    by Anonymous Coward on Wednesday May 02 2007, @02:24PM (#18961183)

    Witness the glacial development of Perl6.
    Feel free to fork, speedy.
    [ Parent ]
  • by zappepcs (820751) on Wednesday May 02 2007, @02:31PM (#18961273)
    (Last Journal: Friday May 18, @11:07AM)
    Well, if you count the number of licenses sold, Linux will _NEVER_ have 20% of the market. What I'm seeing of home users and hearing from people I know, Linux has about 10% or so, and is growing. The cost of Vista and the upgrade pains coupled with the inevitable payment for help they will need is starting to crumble the veil of superiority that Windows has held for so long.

    Yes, that sounds roughly fanboi-ish, but it's a reflection of what I see in the world around me, not what I imagine. I recently handed Ubuntu CDs to two barmaids that were fed up with trying to get Windows for free as they can't afford the cost of a legal copy. They are not technically minded, they installed it themselves and are now very happy and not going back. A decision they made shortly after I gave them advice on what tweaks to make to Firefox... I see this being repeated all the time yet these people will not be counted in the desktop market share wars.
    [ Parent ]
  • by eln (21727) on Wednesday May 02 2007, @02:37PM (#18961363)
    Every time I use Linux, I find it amazing that people still use Open Source software. It's pretty good, but it seems to be missing a lot of key features. Things like 3D acceleration are decades behind Windows. I can't even play Half-Life at all.

    People use Windows because most people are not looking for the same things in an OS that you are. I know it's an easy way to get some karma here on Slashdot, but saying you can't believe anyone uses Windows because the shell sucks and you've had bad experiences resizing pictures is absurd.
    [ Parent ]
  • The philosophy behind textual data (Score:4, Interesting)

    by mangu (126918) on Wednesday May 02 2007, @02:55PM (#18961759)
    it treats piped arguments as objects instead of strings, Psh lets programs access the data directly, instead of having to manipulate large amounts of textual data with tools such as grep or PERL.


    Then they have absolutely no idea about what they are doing. The one big advantage in using pipes is that any application can handle text data.


    Let me give one example: I use the sort command all the time, it sorts data by lines of text, lines are compared according to criteria passed in command options.


    Now, imagine if it depended on binary objects. For every sort operation one would have to write a comparison function to decide which object should come before the other. Writing a special function would mean declaring some form of callback, or maybe some people would call it a closure, whatever. And so on.


    Here's one simple command I use when a disk starts getting full to see which directory is the data hog:
    du -x / | sort -nr > mem.txt &
    What this command does is check the disk usage (du command) in the root directory (/) without looking at symbolic links to other disks (-x option). The result is piped to the sort function, where it's sorted by the numeric value of the first column in reverse order (-nr option). The sorted result is sent to a file named mem.txt. Since checking the whole disk may take some time, it's done in the background (& command). After it finishes, I have a file with the size of each directory in the disk, one line per directory, ordered by size, larger directories first.


    See how powerful it is, having data represented as text? Try writing this line as a Powershell script.


    Another advantage of having data in text format is that you can test it using the keyboard and screen very easily, no need to run a special debugger.


    Instead of trying to reinvent Unix poorly, Microsoft would do a favor to its customers if they accepted Unix is a mighty fine OS and adopted without shame its best features.

    [ Parent ]
    • Re:The philosophy behind textual data by Chris_Jefferson (Score:2) Wednesday May 02 2007, @03:43PM
    • Re:The philosophy behind textual data by 0xABADC0DA (Score:3) Wednesday May 02 2007, @04:14PM
    • Re:The philosophy behind textual data by Dillon2112 (Score:1) Wednesday May 02 2007, @04:16PM
    • Re:The philosophy behind textual data by Peaker (Score:3) Wednesday May 02 2007, @04:24PM
    • by MS-06FZ (832329) on Wednesday May 02 2007, @04:36PM (#18963599)
      (http://1-4-4.home.comcast.net/ | Last Journal: Wednesday March 01 2006, @03:16PM)

      it treats piped arguments as objects instead of strings, Psh lets programs access the data directly, instead of having to manipulate large amounts of textual data with tools such as grep or PERL.


      Then they have absolutely no idea about what they are doing. The one big advantage in using pipes is that any application can handle text data.


      Let me give one example: I use the sort command all the time, it sorts data by lines of text, lines are compared according to criteria passed in command options.


      Now, imagine if it depended on binary objects. For every sort operation one would have to write a comparison function to decide which object should come before the other. Writing a special function would mean declaring some form of callback, or maybe some people would call it a closure, whatever. And so on.


      Here's one simple command I use when a disk starts getting full to see which directory is the data hog:
      du -x / | sort -nr > mem.txt &
      What this command does is check the disk usage (du command) in the root directory (/) without looking at symbolic links to other disks (-x option). The result is piped to the sort function, where it's sorted by the numeric value of the first column in reverse order (-nr option). The sorted result is sent to a file named mem.txt. Since checking the whole disk may take some time, it's done in the background (& command). After it finishes, I have a file with the size of each directory in the disk, one line per directory, ordered by size, larger directories first.


      See how powerful it is, having data represented as text? Try writing this line as a Powershell script.


      Another advantage of having data in text format is that you can test it using the keyboard and screen very easily, no need to run a special debugger.


      Instead of trying to reinvent Unix poorly, Microsoft would do a favor to its customers if they accepted Unix is a mighty fine OS and adopted without shame its best features.

      I strongly disagree with most of what you've said. Here's why.

      The supposed "ease" of dealing with text is an illusion - it's a fallacy that's built out of
      1: the fact that textual formats are usually organized such that we humans can read them if we send the data out to a console
      2: the fact that Unix types have built up a formidable array of text-wrangling utilities to deal with these problems
      3: a general assumption that the reading and writing of formats passed between processes won't pose any real challenge to process.

      The relative "ease" of text is negated if three corresponding conditions are met in a shell dealing in structured data:
      1: Data is structured (or information about the structure of the data is communicated) using mechanisms that are respected by all tools involved. (In other words, there's some kind of Lengua Franca for the structured data - .NET provides this, of course. Similar technologies could provide the same thing on Linux. It's a tall order, mainly because of all the programs in the world that are written for naive assumptions about the shell environment...)
      2: The structured data that is used in inter-process pipelines is given suitable (preferably interactive) display methods
      3: An appropriate set of data handling tools are introduced, generic enough to work for most problems and powerful enough to be effective.

      The problem with textual formats for structured data is that there will always appear ways that you can do it wrong. For instance, what if a field contains the character (or set of characters) you're expecting to use to delimit the fields? Well, that's why find has a -print0 option, isn't it? Now, what if the field could contain null bytes, too? Then maybe you use escape characters - and the process of reading in the output from the previous command starts to become a more complicated parsing problem.

      You cite how easy it is to sort based on a field (and, to extend the exam
      [ Parent ]
    • Re:The philosophy behind textual data by nbagnall (Score:1) Thursday May 03 2007, @08:37PM
    • Re:The philosophy behind textual data by mangu (Score:2) Wednesday May 02 2007, @09:00PM
    • 2 replies beneath your current threshold.
  • by cant_get_a_good_nick (172131) on Wednesday May 02 2007, @03:01PM (#18961853)

    Man, what an insult to Linux. If Linux were worth half the damn that most people here think it is, it should have 20% of the PC market already, much less by 10 years from now. Given how much people trash Microsoft here and talk about how Linux/OSS is so superior, why is Linux/OSS so slow that it'd take 10 years to get to 20% of where Microsoft is TODAY? ;)


    This is one of the few times i can say, i honestly don't know if you're trolling or not, and i don't mean that in any way an insult. Maybe it's a statement to your relative subtlety ;)

    People like things simple, but many things are complex. OS adoption is determined by many factors, technical excellence just being one of them. Consider something "simple" as price?
    • Software cost.
    • software perceived cost (With windows, its usually baked in with the "Microsoft tax")
    • Hardware to support my software cost (do drivers exist for my OS or do i have to do research and buy something)
    • Support cost: who do i call if something goes bad? Who can come over to my house? We're all MS's great unpaid IS support staff.


    I could got on for a paragraph or two just on price alone. Early adoption is done by people who have a whole different class of requirements than the mass market. The fact that Linux is going into the mass market at all is a testament to its usefulness.
    [ Parent ]
  • Actually, PowerShell is pretty damn good. I would say it is ahead of bash, not behind. I'm hoping somebody will steal all the good ideas and turn it into a good shell for linux.

    Examples: Bash is pretty poor where your commands take more than one file and, to a lesser extent, where they produce more than one file.
    For instance if you have two directories a and b and want to do a diff on their contents, what do you do:
    % mkfifo /tmp/lsa
    % mkfifo /tmp/lsb
    % ls a > /tmp/lsa &
    % ls b > /tmp/lsb &
    % diff /tmp/ls{a,b}

    That's just disgusting.

    And control of GUI applications - KDE is a quite nice scripting langauge but it isn't a shell. Bash has virtually no gui scripting and I'd call its tie in with KDE's scripting poor - only the most basic datatypes can be exchanged.

    Compare to applescript for an example of a fairly powerful modern scripting system.

    Imagine, a whole post on the deficency of the unix shells and I didn't even mention my pet hate of escaping!
    [ Parent ]
  • Re:Windows "power shell"? (Score:5, Interesting)

    by MS-06FZ (832329) on Wednesday May 02 2007, @03:38PM (#18962529)
    (http://1-4-4.home.comcast.net/ | Last Journal: Wednesday March 01 2006, @03:16PM)

    has microsoft submitted to linux and unix? we have had a "power shell" for a few decades now..
    You sure about that? I think we have crusty old 1970s shells with a veneer of tab-completion and command history added for convenience. I would really like to see that situation change. I like the CLI and I think it's a powerful way to work - if the shell is up to the task. CLI shells ought to be able to, for instance, access the GUI (if any), as well as interact with running applications. These tasks can technically be done with just about any shell - but only in the sense that a program that runs under the shell can do some task and report back information to the shell environment - and the ability to do that is limited by what data types the shell can handle. Bash can handle one datatype, basically - text. It can't handle structured data, it doesn't really support binary data or numbers, let alone live objects you could interact with. I think this is a source of a lot of busywork in traditional shells - you run a program that, say, prints out numeric data from a matrix file, then to process that data the next program in the chain needs to parse the overall output, convert the numbers back to binary, and then probably re-format and print them out as text again. It makes no sense.

    I really, really want the Linux CLI to be modernized. (Lots of time is spent working on the Linux GUI, but it seems like when it comes to the CLI people are content to let it rot.) I've spent a lot of time trying to figure out how I would go about doing that. I've read a bit about PowerShell - it seems interesting, at least, and promising. For instance:
    - It can wrangle live .NET objects and complex datatypes
    - It encourages a unified interface (conventions for command options, etc.) for CLI programs and utilities
    - It applies these new techniques in conjunction with existing, traditional shell mechanisms, like pipes.
    - It endeavors to make documentation and general information about commands easier to access

    Now, there's also things I don't like so much - for instance, the distinction between "commandlets" and normal commands. (To be fair, this is largely due to the fact that most existing code in the world is written either for a traditional CLI or a GUI - so most code isn't going to know how to deal with a smart CLI anyway. But I think there are better solutions.)

    I think it's kind of a drag that Microsoft may now have a better CLI than Linux - but I think that's a situation that can be changed.
    [ Parent ]
    • Re:Windows "power shell"? by dhasenan (Score:2) Wednesday May 02 2007, @03:52PM
      • Re:Windows "power shell"? (Score:5, Interesting)

        by MS-06FZ (832329) on Wednesday May 02 2007, @05:04PM (#18964119)
        (http://1-4-4.home.comcast.net/ | Last Journal: Wednesday March 01 2006, @03:16PM)

        Text is universal, though, and it lets you have a single means of output for simpler programs. Want to read the results immediately? Just call the program. Want to save the results? Dump them to a file to review later.
        Text is only universal because we've made it universal. This is the same idea behind XML - it's mainly useful because it's recognized. And text isn't "human-readable" - it's binary just like everything else. It just happens that the process of displaying it is rather simple and the programs to do that are already out there.

        If you look at Powershell, they've got the "read immediately" process down - commands like "Format-Table" come to mind. Yeah, big deal, right? It's what PERL was born to do. But nevertheless - if you run a command and it generates an object, a meaningful printed representation of that data appears on the console. If you want it to look nicer, there are commands to format the output. I think the shell would be better if the user didn't need to handle that step explicitly - I have some ideas for how that could be done. (I am very interested in writing a Linux shell with these kinds of capabilities.)

        This makes it trivially easy for programmers to modify the output, or for the users to use it in unexpected ways. It means we don't need a separate program to convert binary data to a human-readable form first.
        From my perspective you've got it backwards. Every single program in a pipeline chain is burdened with the job of converting "human-readable" data to a useful, processable form - and then back to text again for the next chump in the line. So maybe you save one step, because you don't need to reformat the output of your last command - but you've added on two steps for every command in the chain (minus one, for the first) - and when programs start to get even moderately outside the realm of the common, everyday stuff, the user starts having to deal with those processes themselves.

        Complex datatypes in a shell are only good if you're using a set of languages that can deal with the same objects. With Unix, not all your languages have a concept such as an object -- not even a struct. Even then, you need a human-readable form for them, even if they're converted at the user's request.

        As long as Monad has that, it's probably decent. But that's going to be application-specific.
        True, that is a problem. Not so much the languages' limitations in handling objects - that's just syntax. You can write object-oriented code in C if you feel like it, and certainly C can interface with object managers like CORBA - it just wouldn't be especially fun. It's more the problem of having a common communication format - that's a hard sell because people don't think they need it, and it's a bit of a tall order to mandate something like that.

        In what sense is Monad's pipeline communication format "application-specific"? It can deal with any .NET object. If you had an object with a field called "Title" that had a value "Foozle", you could access that any way you like. It's not application-specific. You want a human-readable form? "Title : Foozle" pretty much does it. :)
        [ Parent ]
        • Re:Windows "power shell"? by Furry Ice (Score:2) Wednesday May 02 2007, @11:21PM
        • Text is only universal because we've made it universal.
          Not quite. Text is universal by virtue of it being a stream of bytes, and byte streams are universal in that almost all current computer architectures, networks, storage devices and other devices handle byte streams. In that regard, text isn't just universal in that all programs that you can pipe together in a shell can handle it, but also since you can read it from disk, store it to disk, send/receive it over a network or even send it over an RS232 link, if you so wish.

          There is, however, no universally agreed syntax for "objects". Sure, there have been attempts, but I doubt any of them will succeed, maybe ever. Different systems have so vastly different opinions of what an object is, and I believe that is how it should be, because if all systems would have to have the same idea of an object, you would be locking them into a predefined design pattern, and innovation might decrease. I don't know if maybe people said the same thing about bytes in the 50s and 60s, so I wouldn't bet my prediction will turn out to be correct, though.

          Of course, this is perfect for Microsoft. They don't want other systems, anyway. As long as anyone can agree on the .NET definition of an "object", Microsoft will be happy. However, even then, the fact remains that not every .NET object is serializable -- you can't just take an arbitrary object and squirt (pun intended) it over the network or store it on disk. As long as you wish to communicate with anything outside your own VM, text (or at least a byte stream) is necessary.

          And text isn't "human-readable"
          Heh, that's one of the weirder statements I've seen as of late. Kind of like saying that you can't "speak" in a telephone, it's just a PCM stream anyway. Call me weird, but I'd argue that text is human readable by definition. I do (kind of) see your point, though, but I don't agree. Text is always human readable, because it has such an internal structure that makes it human readable with an extremely simple and universally standardized (except for charset) algorithm. If you just have an "object", though, there's no universal algorithm for turning it into a visual structure. Usually, each object class even has its own such algorithm, which isn't usually reversible (unlike text), and not every class even does. To begin with, there is, as I wrote above, no guarantee of any sort that an object is even slightly serializable.

          Not that I think that you're wrong in every possible way. I definitely think that an object-oriented shell may have its virtues, but it's never going to work outside its own VM. Text is universal, since you can send it anywhere and receive it from anywhere. That "anywhere" includes a human, too.

          [ Parent ]
        • Re:Windows "power shell"? by fuliginous (Score:1) Thursday May 03 2007, @06:34AM
        • Re:Windows "power shell"? by try_anything (Score:2) Monday May 07 2007, @03:34AM
      • Re:Windows "power shell"? by seaturnip (Score:1) Wednesday May 02 2007, @05:54PM
    • Re:Windows "power shell"? by SL Baur (Score:2) Wednesday May 02 2007, @04:51PM
    • GNU/Linux is more than the shell. by twitter (Score:2) Wednesday May 02 2007, @06:00PM
    • Re:Windows "power shell"? by kestasjk (Score:2) Wednesday May 02 2007, @07:55PM
    • Re:Windows "power shell"? by DragonWriter (Score:3) Wednesday May 02 2007, @09:57PM
    • Re:Windows "power shell"? by pkphilip (Score:2) Thursday May 03 2007, @02:10AM
    • Re:Windows "power shell"? by cain (Score:1) Thursday May 03 2007, @08:15AM
    • You want CORBA then? by jotaeleemeese (Score:2) Thursday May 03 2007, @12:52PM
    • The functionality gap between GUI and command-line by MS-06FZ (Score:2) Monday May 07 2007, @12:35PM
    • 1 reply beneath your current threshold.
  • Because so many commercial apps are Windows-only, duh.

    Any more stupid questions?
    [ Parent ]
  • Re:one nad? (Score:2)

    by bwcbwc (601780) on Wednesday May 02 2007, @04:46PM (#18963803)
    Dunno. It could also be "Moan Ad" or "Mo' nad".
    [ Parent ]
  • by MightyMartian (840721) on Wednesday May 02 2007, @10:42PM (#18967559)
    (Last Journal: Tuesday March 13 2007, @02:39PM)
    Why are we talking specifically about Linux here? sh runs on every variety of *nix, has decades of techniques and development, and up until this latest effort by Microsoft, had absolute no competitor in the Windows world. Windows NT servers have existed since the early 1990s without a decent bloody command line. We've been forced to either use goddamn scripting languages like VBScript or go grab sh variants and kludge them into running on *nix.

    It amazes me just how little all the Windows advocates out there actually understand about the world of system administration and maintenance. They're so goddamn addicted to their little GUI tools, and yet they are so often forced to use substandard tools for automation. I'm not saying sh and its descendants are perfect, but compared to that worthless DOSesque piece of shit called CMD.EXE, they're like friggin' Einsteins compared to a low-level functioning mental retard.

    I could give a shit about desktops, about whiz-bang GUI config settings. I find them so appalling inferior to a simple .conf file, which I can open up in any goddamn text editor, modify and save, quickly test and quickly make an easily usuable back up copy. I can administrate a goddamn *nix box with ssh and a text interface, even when I'm forced to go over a dialup connection. The text editors are optimized for terminal usage, which is precisely why *nix kicks the shit out of Windows in the server world.

    Windows administration is an exercise in visual masturbation. It may take me a couple of hours longer to get Samba running, but management is infinitely easier. Follow a few basic rules about backing up conf files, and you can test things out, and if it doesn't work, just copy the backup conf file back, restart the Samba processes, and bang, all the evils you brought into the world just disappear. Windows and its advocates are based on the model that everything has to have fucking check boxes, radio buttons and drop down lists. I mean having to have a bloody script to control GUI apps is so symptomatic of the psychological disease your breed suffer from. Rather than learning how to function in an economical fashion, its all about finding reasons to justify the existence of a GUI on a server.

    I won't debate that for Joe Q. Average, Windows is still at the top of the heap. But don't give me that shit about server environments, where the requirements are so different. I welcome the day when Microsoft gives me a command-line and simple scripting interface where I can modify any part of the system from a terminal session. But even giving us that won't answer horrors like the registry. How could you ever produce a CLI tool that could meaningfully control that. Guess what, on *nix boxes, it's as simple as vi, emacs, or even some Wordstar clone like joe if that's more you speed.
    [ Parent ]
  • "but those only get you so far" Huh??? WTF???

    Anyone else wonder what this means? I guess the question is, where do those leave you unsatisfied? To my knowledge, these (cygwin, active perl, etc) integrate with all features of windows...including, but not limited to, native features like COM objects.

    So what basis in fact does this statement have, if any? Sounds like Microsoft-funded propoganda.
    From my perspective, the limit is in the extent to which the shell works to support data exchange between programs.

    Why does the shell need to support data exchange between programs? Well, that's the whole idea between Unix pipes. Bash supports text streams (or rather, byte streams commonly assumed to be textual) between processes, and that's it. And that could be enough - given a universally respected set of conventions on how to format and identify datatypes. So if ActivePerl gets some nice chunk of data out of a running GUI application, and at bash you're trying to pipe that data output into something else - there's a rather cumbersome process of turning that Perl data into a raw bytestream and turning it back into useful data again. The complexity of this problem depends on the complexity of the data - and bash's willful ignorance of the significance of the data that goes between processes means that it can't help in any way.

    What's specifically missing is shell-level support for interacting with GUI applications at the same level that ActivePerl is capable of. Bash's support for datatypes isn't sufficient to make it a good way to interface with scriptable applications.

    A statement like "but those only get you so far" is a bit vauge - but I think I can see the point.
    [ Parent ]
  • 13 replies beneath your current threshold.