Slashdot Mirror


Windows PowerShell in Action

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.

442 comments

  1. Monad by Profane+MuthaFucka · · Score: 5, Funny

    Named after the designer lost a testicle in a tragic chair throwing accident.

    --
    Fascism trolls keeping me up every night. When I starts a preachin', he HITS ME WITH HIS REICH!
    1. Re:Monad by jcgf · · Score: 1

      I saw the word monad and I thought Haskell, but alas no.

    2. Re:Monad by Anonymous Coward · · Score: 1

      The shell was actually initially designed by a noteworthy Haskell developer, hence the original name.

    3. Re:Monad by felipekk · · Score: 1

      I don't get this chair trowing jokes. Can anyone please enlighten me?

    4. Re:Monad by trparky · · Score: 2, Informative
    5. Re:Monad by Anonymous Coward · · Score: 0
    6. Re:Monad by Anonymous Coward · · Score: 0

      Was it Gang Wang?

      Sorry Gang, I counldn't resist.

      For anyone that doesn't know: "Inventor" of a lot of Microsoft "patents".
      Example:
      http://patft.uspto.gov/netacgi/nph-Parser?Sect1=PT O1&Sect2=HITOFF&d=PALL&p=1&u=%2Fnetahtml%2FPTO%2Fs rchnum.htm&r=1&f=G&l=50&s1=6775781.PN.&OS=PN/67757 81&RS=PN/6775781

    7. Re:Monad by grolschie · · Score: 1

      Well sort of. :-)

    8. Re:Monad by jsnover · · Score: 5, Informative

      That is not the case. I gave it the name Monad because of my respect for Leibniz. Wikipedia has this right: http://en.wikipedia.org/wiki/Windows_PowerShell

    9. Re:Monad by Anonymous Coward · · Score: 0

      Maybe you should have named it something that sounded less Jewish.

  2. PowerShell by El+Lobo · · Score: 2, Interesting

    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...

    --
    It's time to realise that Abble's products are the biggest abomination these days. Just say NO to the dumb iAbble way!!
    1. Re:PowerShell by Jeremiah+Cornelius · · Score: 1

      Yeah. Lets port to Mono ASAP!

      This message piped directly to your Term via stin...

      --
      "Flyin' in just a sweet place,
      Never been known to fail..."
    2. Re:PowerShell by Anonymous Coward · · Score: 0

      The .NET integration means you can use PowerShell with any .NET assembly, so if you for instance have an application with a .NET plugin interface you can use PowerShell to control it from the command line. The moment I realized that everything in PowerShell were real objects and that I had the entire .NET class library at my disposal was a real eye-opener.

  3. Re:Windows "power shell"? by Svippy · · Score: 0

    Nah, they just want every OS to be like Vista.

    --
    Clicked pie.
  4. At this rate... by pnuema · · Score: 5, Insightful

    ...in 20 years MS will invent UNIX.

    1. Re:At this rate... by JPriest · · Score: 4, Informative

      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"

      --
      Saying Java is nice because it works on all OS's is like saying that anal sex is nice because it works on all genders.
    2. Re:At this rate... by Shawn+is+an+Asshole · · Score: 3, Informative

      You mean again?

      --
      "It ain't a war against drugs.it's a war against personal freedom" --Bill Hicks
    3. Re:At this rate... by PhrostyMcByte · · Score: 4, Informative

      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".

    4. Re:At this rate... by morgan_greywolf · · Score: 1, Redundant

      "Those who fail to learn the lessons of Unix are doomed to re-invent it. Poorly." -- Forgot who said it.

    5. Re:At this rate... by misleb · · Score: 1

      From what I understand, powershell takes the shell scripting to a whole new level that no *nix does. For example, you can pass objects between applications and other scripts rather than piping text/raw data between them. I'd actually like to give it try some time. Too bad (yea right!) I don't have many Windows servers to put it to the test on.

      -matthew

      --
      "THERE IS NO JUSTICE, THERE IS ONLY ME." -Death
    6. Re:At this rate... by jimstapleton · · Score: 1

      Any other requests?

      Actually, I think you can do that with plain old python also, it's just not as "friendly"

      --
      34486853790
      Connection too slow for X forwarding? Try "ssh -CX user@host"
    7. Re:At this rate... by Anonymous Coward · · Score: 2, Insightful

      The shell is a text interface, if I want OOP I can call a different scripting language for every day of the week and then some.

      What's to understand here?

    8. Re:At this rate... by dAzED1 · · Score: 0, Flamebait

      you're not being serious, are you? Hope not, yet your post is mod'd "interesting" instead of "funny."

      First, that's a poor definition of "object" - second, I can pass non-text data from one function to another with no prob.

      you might notice that | symbol there lets ya chain stuff. Well gosh, I've been doing that in Unix for 14 years. Binary data, text, whatever I want to pass. It's been possible in Unix for longer than that, I'm just speaking to how long *I* have been doing it.

      ls| sed -e 's/^d/b/'|mailx -s "oh no!" phrosty

    9. Re:At this rate... by fm6 · · Score: 1

      Yes, PSH (boy, that name sucks) copies things like pipelines from Unix shells. It also has some features that no Unix shell every thought of, like script signing and support for hierarchical data stores.

    10. Re:At this rate... by PhrostyMcByte · · Score: 1

      First, that's a poor definition of "object"

      I never defined object. If you would like clarification, they _are_ objects you pass around. Everything is an instance of a .NET class. Doing "ls | get-member" lets me know it is giving me back DirectoryInfo and FileInfo objects, complete with all the properties and methods you could ask for.

      you might notice that | symbol there lets ya chain stuff.

      I'm not claiming Powershell was the first to invent the pipe - god no. I just meant to point out that *finally* Windows has something on equal ground to *nix.

      ls| sed -e 's/^d/b/'|mailx -s "oh no!" phrosty

      And if you used Powershell, you wouldn't have to do any text processing. That's all I was pointing out with that (poor) example. That and the above, that you can finally pipe crap together.

    11. Re:At this rate... by archen · · Score: 5, Interesting

      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.

    12. Re:At this rate... by nanosquid · · Score: 3, Funny

      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)

    13. Re:At this rate... by cduffy · · Score: 2, Informative

      There are experimental shells for Unix that do that sort of thing; most of us just don't see the point.

      http://geophile.com/osh/index.html
      http://dispatch.sourceforge.net/

    14. Re:At this rate... by Anonymous Coward · · Score: 0

      It also has some features that no Unix shell every thought of, like script signing and support for hierarchical data stores.
      That is because:
      • Config files are plain text, instead of being stuck in the mess that is the Jet db Registry in Windows
      • They don't have to because it is not a stand alone tool, there are hundreds of GNU utilities that handle things like searching, updating, parsing, as well as db access that can also be used separately or with tools other than a specific shell
    15. Re:At this rate... by The+Lord+of+Chaos · · Score: 1

      Did you mean to say eunuchs? Seeing as how they've created monads already they are only one gonad away...

    16. Re:At this rate... by Anonymous Coward · · Score: 0
      So what's the equivalent of something trivial like this?

      #!/bin/bash
      # Renames "$file.$argv[1]" to "$file.$argv[2]"
      for file in *.$1;
      do
        mv $file ${file//.$1/.$2}
      done
    17. Re:At this rate... by massysett · · Score: 1

      Not only that, but the syntax is EXTREMELY CONSISTENT.

      There's something to be said for that. For instance many Unix utilities operate on lines that have been delimited into fields. So you have to tell the command what your delimeter is. In sort, you do this with -t. With cut, you do it with -d. With awk, you do it with -F. If I'm writing a script with all three, I have to check manpages to see what option to use. This is Unix at its worst.

      But at least Unix has cut, awk, and sort; what I haven't seen anyone write about yet is whether Windows Power Shell has anything like those utilities, or the scores of other utilities that make a shell useful. The entire Unix command-line suite, reworked with consistent syntax, would be nice.

    18. Re:At this rate... by MS-06FZ · · Score: 1

      "Those who fail to learn the lessons of Unix are doomed to re-invent it. Poorly."
      -- Forgot who said it. True - but if you look at the shell they've cooked up, maybe they didn't do so poorly after all. There's a lot of great ideas in that thing.
      --
      ---GEC
      I'm but the humble pupil, seeking to snatch the scratchbuilt pebble from the master's fully articulated hand
    19. Re:At this rate... by arth1 · · Score: 1

      It also allows shortcut versions of commands so you don't have to type the entire "wordy" version of the command.

      That means it's not extensible and consistent. If you've written "foo" as short for "foobar" in your scripts, your scripts are hosed when "foobaz" and "foo" are implemented.

      Other than that, object orientation and abstractions can serve useful purposes. But not necessarily in a script, where you want to be able to single-step and know exactly what's going on at each immutable step. Scripts are useful as long as they give the user FULL control. As soon as they don't, they're better implemented as applications.
    20. Re:At this rate... by SnarfQuest · · Score: 0, Troll

      And of course, they will patent it.

      --
      Who would win this election: Andrew Weiner vs Andrew Weiner's weiner.
    21. Re:At this rate... by ray-auch · · Score: 1

      none, because on windows you'd just do:

            ren *.whatever *.whateverelse

      without having to write a separate script for it (and without needing powershell actually).

    22. Re:At this rate... by dhasenan · · Score: 1

      Hierarchical data stores? You mean like putting config files into a directory structure, or having XML-based config files? Everything's text, it's just how you arrange and interpret it.

      Script signing sounds like something I'll never need. It's rare enough that some random developer has the funds lying around to pay a signing authority to sign their stuff that I wouldn't take the lack of signing to be indicative of anything, and most of the signing authorities just sign anything that comes with enough money, so if I get a signed script, that doesn't mean it's secure.

    23. Re:At this rate... by DarkEntity · · Score: 0, Troll

      Heh, I always love hearing about Xenix. It's like the AIDS of computer world. Just gets passed from one evil person to the next and never really ceases to haunt them...

    24. Re:At this rate... by Bacon+Bits · · Score: 1

      Ext3cow wasn't exactly innovative either. I don't remember derisive laughter in that story.

      --
      The road to tyranny has always been paved with claims of necessity.
    25. Re:At this rate... by Nutria · · Score: 1
      Wake me up when *nix gets an object-oriented (rather than text-oriented) shell.

      Python? http://ipython.scipy.org/

      --
      "I don't know, therefore Aliens" Wafflebox1
    26. Re:At this rate... by Tanktalus · · Score: 2, Interesting

      Why not just use "rename"?

      rename .ext1 .ext2 *.ext1
      I'm actually thinking of something just a bit more complex:

      for file in *.avi; do ffmpeg -i $file -target dvd -aspect 16:9 ${file%avi}mpg; done
      Not that I have a use for something like that, mind you...
    27. Re:At this rate... by Thundersnatch · · Score: 3, Informative

      The FOR command 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.

    28. Re:At this rate... by MS-06FZ · · Score: 1

      The shell is a text interface, if I want OOP I can call a different scripting language for every day of the week and then some.

      What's to understand here? Yeah, but how many of them are actually shells? Good shells? What's involved in running Pine from within a Python interactive session?

      And then, here's my favorite bit - suppose you have code in Python that does some processing for you and generates some data - maybe even a live object - you want to pipe it out to a Ruby script. If you have an object-oriented shell you can do that shit, no problem. If you have a text-oriented shell, it depends a lot on how complex the data is.
      --
      ---GEC
      I'm but the humble pupil, seeking to snatch the scratchbuilt pebble from the master's fully articulated hand
    29. Re:At this rate... by Jugalator · · Score: 1

      Python is not a shell... :-p

      You're more comparing Python with IronPython now.

      I mean, here, the output of the ls command is an array of file objects.

      --
      Beware: In C++, your friends can see your privates!
    30. Re:At this rate... by Jugalator · · Score: 1

      Well gosh, I've been doing that in Unix for 14 years.

      Yes, but pay attention to the explicit formatting you need to give in your example.
      The point of PowerShell is that you don't need to parse out/inputs.

      --
      Beware: In C++, your friends can see your privates!
    31. Re:At this rate... by renoX · · Score: 2, Insightful

      >I can pass non-text data from one function to another with no prob.

      Sure, the pipe can pass anything, but as there is no standard to pass anything but ASCII encoded text, you're more or less restricted to use this on Unix otherwise you'll have to modify all the tools: watch how slow the transition to Unicode was..

      In theory, one could define a 'common' binary encoding of objects easily on Linux, but then you have to modify each tool, each scripting language to make it work, a huge task..
      In practice, especially on Linux it's nearly impossible: there is no central authority: remember, there are *still* copy/paste problems between some toolkits..

    32. Re:At this rate... by vux984 · · Score: 1

      Object Oriented?

      AhHa... so this has nothing do with catching up to *nix.

      PowerShell is really just Microsoft finally Innovating "AppleScript".

    33. Re:At this rate... by Jugalator · · Score: 1

      That's the closest I've seen come to it yet, however it still require kludges like "!" prefixes to integrate with the outside world, and "magic" commands like "%cd" to navigate the file structure.

      --
      Beware: In C++, your friends can see your privates!
    34. Re:At this rate... by Anonymous Coward · · Score: 0

      The point of PowerShell is that you don't need to parse out/inputs.

      What if you don't happen to want something which is neatly provided by the object's API?

      Maybe you want something which is only a substring of what is returned from a method. At that point, you're back to parsing output, or at least using a regex.

    35. Re:At this rate... by inKubus · · Score: 1

      True - but if you look at the shell they've cooked up, maybe they didn't do so poorly after all. There's a lot of great ideas in that thing.

      I take it you haven't installed it and tried using it yet?

      --
      Cool! Amazing Toys.
    36. Re:At this rate... by dwater · · Score: 1

      > for file in *.avi; do ffmpeg -i $file -target dvd -aspect 16:9 ${file%avi}mpg; done

      Will that work with files that contain spaces?

      --
      Max.
    37. Re:At this rate... by dAzED1 · · Score: 0

      I'm not claiming Powershell was the first to invent the pipe - god no. I just meant to point out that *finally* Windows has something on equal ground to *nix.

      reeeeallly. Who wrote this, then?

      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.

      socket to socket communication has been around in Unix since it was born. That is one of the fundamentals of Unix. Hell, it is one of the reasons X-windows is doomed to suck forever.

    38. Re:At this rate... by dwater · · Score: 1

      > your scripts are hosed when "foobaz" and "foo" are implemented. ..but commands are easily over-ridden by using PATH, no?

      --
      Max.
    39. Re:At this rate... by Jonsey · · Score: 2, Informative

      While I can't comment on any of the rest of it. (Yeah, I work for 'em)

      I can offer a link to the download.microsoft.com page that pulls it for Vista. (all links are English x86, if you run English x64, you'll be able to navigate the download center by now).

      Vista x86: http://www.microsoft.com/downloads/details.aspx?Fa milyID=c6ef4735-c7de-46a2-997a-ea58fdfcba63&Displa yLang=en

      XP x86: http://www.microsoft.com/downloads/info.aspx?na=22 &p=1&SrcDisplayLang=en&SrcCategoryId=&SrcFamilyId= &u=%2Fdownloads%2Fdetails.aspx%3FFamilyID%3D6ccb7e 0d-8f1d-4b97-a397-47bcc8ba3806%26DisplayLang%3Den

      WS03 x86: http://www.microsoft.com/downloads/info.aspx?na=22 &p=2&SrcDisplayLang=en&SrcCategoryId=&SrcFamilyId= &u=%2Fdownloads%2Fdetails.aspx%3FFamilyID%3D10ee29 af-7c3a-4057-8367-c9c1dab6e2bf%26DisplayLang%3Den

      Get it, use it!

        -- I worked briefly doing part of the steps of release management for this, so it's cool to see that people are enjoying it.

      --
      I assert that my comment is only my opinion, not that of any employer, past, present or future.
    40. Re:At this rate... by MS-06FZ · · Score: 1

      True - but if you look at the shell they've cooked up, maybe they didn't do so poorly after all. There's a lot of great ideas in that thing.

      I take it you haven't installed it and tried using it yet? Um... I'll get back to you on that. :D

      I know someone mentioned the thing is bloody slow - any other reactions to the thing?

      Right now, mostly I appreciate the idea of this thing - what it's capable of and what it's striving to accomplish. I think it's a good idea. Would it be my shell of choice? Yeeg, I don't know about that, the commands are all really long and every example command from the docs is full of scary Windows-isms... I just think "complacent faith in Bourne Shell tradition" isn't the right reaction to this thing. I think it has a lot more potential than that.
      --
      ---GEC
      I'm but the humble pupil, seeking to snatch the scratchbuilt pebble from the master's fully articulated hand
    41. Re:At this rate... by ucblockhead · · Score: 1

      Unix has an object-oriented shell. It's called "python".

      --
      The cake is a pie
    42. Re:At this rate... by Anonymous Coward · · Score: 0

      Why would anybody want to run pine from within a scripting language that already has IMAP, mailbox, rfc822 and smtplib modules?

      If want to pipe an object from one scripting language to another via a shell script you can serialize it as json or YAML, even pipe that serialized data through sed. Many scripting languages have shells and I'm not aware that anybody bothered making one into a object orientated /bin/sh replacement. It's better to use the right tool for the job and to hint at a common saying; Microsoft just gave you a hammer.

    43. Re:At this rate... by Anonymous Coward · · Score: 0

      You have 'text'. You have 'arbitary binary data'.

      But can you "dir | converto-html" ? And the columns come out right? (File size in its column, creation date in its column etc)? And you didn't have to work out what the seperators are or even care what order they're in? And the output already has a correct header row?

      No?

      Didn't think so.

      That's what happens when the "dir" command returns a list of objects instead of plain ascii text or arbitary binary data.

    44. Re:At this rate... by CrankyOldBastard · · Score: 1

      You mean like a Squeak Workspace with the OSProcess plugin? It's only 35 year old technology...

    45. Re:At this rate... by Anonymous Coward · · Score: 0

      Good god. " the " is whitespace in AppleScript. And so few applications actually support it well (PowerPoint crashes when you try to add a picture to a slide, Keynote 1 and 2 expose zero functionality, etc)

    46. Re:At this rate... by toadlife · · Score: 0

      I think the script signing feature is not designed for the scenario you're thinking of. Instead I think it's meant to help control which scripts can run inside a Windows domain.

      A Windows admin can create an in-house cert authority, sign his own scripts and then configure the domain computers to trust the in-house authority. The admin can then mandate that the domain computers only run signed powershell scripts. With this in place, the admin can deploy his own config scripts to the domain computers, but users wouldn't be able to infect themselves with powershell-bases mal-ware (coming soon to a corporate network near you!), because it won't be signed.

      It should be handy for the five Windows admins on the planet who understand enough to implement it.

      --
      I don't always use unix-like operating systems; but when I do, I prefer FreeBSD.
    47. Re:At this rate... by Anonymous Coward · · Score: 1, Informative

      actually no because the power shell refuses to run things which are ambiguous.

    48. Re:At this rate... by Anonymous Coward · · Score: 0

      I agree. Unix shells are a very poor choice to do any real progamming work.

    49. Re:At this rate... by EtherMonkey · · Score: 1
      no. the closest you can get is:

      for %f in (*.avi) do ffmpeg -i "%f" -target dvd -aspect 16x9 "%f.mpg"
      If used in a script, change the single "%" to "%%". File extension is not renamed, new extension is concatenated. You would need to follow-up with something like

      ren "*.avi.mpg" "*.mpg"
      I don't think the colon will work, might be interpreted as a device name, but i'm not sure. Assuming there's a windows version of ffmpeg, the docs should tell you if an alternate parameter format is required.
      --
      --- A man with a briefcase can steal more money, than any man with a gun. [Don Henley]
    50. Re:At this rate... by GrievousMistake · · Score: 1

      I love Python to death, but the file handling in a standard Python install is awful enough that I've on occasions just ran a .bat file from my script rather than dealing with it. They seriously need to include a decent path class.
      For a shell language it also gets redundant having to quote filenames and add parenthesis to all commands.
      I find that even simple things like doing something to all files in a directory matching some pattern, with or without recursion, behave quirky in Python.
      Now I've seen people pimping Python in /. shell articles before, so either I need to be set straight with some Python advice, or we are talking about a different Python. Are you people by any chance managing your system with real living pythonidae?

      --
      In a fair world, refrigerators would make electricity.
    51. Re:At this rate... by Anonymous Coward · · Score: 0

      The GP script was accepting command line arguments. Yours does not. Big difference.

    52. Re:At this rate... by that+this+is+not+und · · Score: 1

      I just meant to point out that *finally* Windows has something on equal ground to *nix.

      I would define 'on equal ground to Unix' as meaning it ran equally well on Unix as on the 'doze.

      So I have to ask: where's the source tarball for this thing? Is anybody working on integrating it into pkgsrc for NetBSD? What other platforms have it in their ports collection already?

    53. Re:At this rate... by MightyMartian · · Score: 2, Insightful

      Most people don't know, because the minute they go into the docs to find out how to do something non-trivial, they find out that CMD.EXE may actually be the most convoluted godawful shell ever invented. It's ugly, horrible and a pain. It's so inferior to sh that I can't imagine anyone seriously mentioning them in the same sentence.

      --
      The world's burning. Moped Jesus spotted on I50. Details at 11.
    54. Re:At this rate... by allthingscode · · Score: 1

      True, but what if I want to the dates so that I can get all of the files that were created in january, 2005 from a folder where a lot of the files have the name Janice buried in the name. I'm sure all of the *nix Gods here can do this without thinking, but since it will be YEARS before I could do command line parsing like this without thinking, it would be cool to be able to do something like ask the file object for its date.

    55. Re:At this rate... by TimboJones · · Score: 1
      Try this:

      for %f in (*.avi) do ffmpeg -i "%f" -target dvd -aspect 16x9 "%~dpnf.mpg"


      The tilde syntax allows you to do some real fun stuff with file paths. Assuming that %f refers to a file, %~dpnxf gives fully-qualified drive + path + filename + extension. Leave off the x, you leave off the extension. Doesn't matter if %f uses absolute or relative syntax. See the help page for 'for' in c:\windows\help\ntcmds.chm for further details.

      Window's for allows you to do some really wild stuff, using batshit crazy syntax.

    56. Re:At this rate... by jlarocco · · Score: 1

      the real advantage is that everything you pass between commands is an object.

      That's not an advantage, it's just stupid. Leave it to Microsoft to completely over-complicate something as simple as a shell. They should have saved time and money and just installed Cygwin.

    57. Re:At this rate... by Furry+Ice · · Score: 2, Interesting

      Rather than wait years to learn how to do this kind of parsing, just start learning now.

      The solution to the problem of separating out "Jan" in the date from "Jan" in the filename is to realize that position matters.

      The data returned from "ls -l" is formatted in columns (that's why the filename comes last--it could have spaces in it!).

      I'm sure there are a lot of tools that can do this task, but awk is often a good replacement for grep when you need to look at a specific column.

      Here's some sample data:

      ls -l
      drwxrwxr-x 3 phiggins phiggins 4096 Jan 22 2005 www
      -rw-rw-r-- 1 phiggins phiggins 5746 Apr 10 13:32 xorg

      You can see the month is column 6, so let's try out some awk:

      ls -l | awk '$6 == "Jan"'
      drwxrwxr-x 3 phiggins phiggins 4096 Jan 22 2005 www

      awk is a bit weird and takes some learning, but the most important thing to remember is that many characters that awk uses will be interpreted by the shell, so always put your awk script inside single quotes. If you try to use double quotes, you're going to beat your head many times trying to figure out what's wrong with your program.

      You can match on a regex using:

      ls -l | awk '$6 ~ /Ja/'

      The part I've left out is the action part. An awk line consists of a pattern and an action. If the pattern is left out, it defaults to the pattern that matches every line. If the action is left out, it defaults to the action of printing out the whole line.

      Actions are enclosed in curly braces (one of the key reasons to enclose your script in single quotes!). Probably the most common thing to do is print out a subset of the fields of the line:

      ls -l | awk '$6 ~ /Ja/ {print $9}'
      www

      That will print just the filename. I've been slowly picking up more advanced pieces of awk over time, but even if you only know these basics, it can really help parse a lot of things that grep is unable to deal with!

    58. Re:At this rate... by o2sd · · Score: 1

      They should have saved time and money and just installed Cygwin.

      How would that have saved any time? I just tried to install Cygwin, it spent 30 minutes installing stuff, and then it wouldn't start because it was missing 'cygwin1.dll'. I mean sheesh, you think of all the frickin files the installer would fail to install, the actual cygwin dll would not be one of them.

      --
      - Nothing to see hear.
    59. Re:At this rate... by jlarocco · · Score: 1

      How would that have saved any time?

      Cygwin is already developed and released for free by other people. It would be trivial to add a small cygwin installation to Windows during the Windows install process. Instead they probably spent millions of dollars on crap that's just going to be compared (unfavorably) to the shells in Cygwin and *nix.

      Maybe I should have said "They should have just repackaged FreeBSD or Debian instead of wasting time and money on Vista and PowerShell."

      Oh, and if you're really having that 'cygwin1.dll' problem, check that the cygwin directory is in your $PATH.

    60. Re:At this rate... by jhol13 · · Score: 1

      The "object oriented" idea sounds good. Until you, the human, need to look at the intermediate results.

      Like (trivial) "ls > ls.txt; sort ls.txt". Now if ls produces human readable output the output cannot be object. Therefore sort must be able to parse text, not objects.

      In practice it means it is extremely nice that everything is text, every application (and there are quite a few in *nix) understands text. Only because humans do. And that is what command line is for: humans.

      If, OTOH, you want to pass objects (as they make error prone parsing unnecessary) you can use, as pointed out, Perl/BeanShell/... Those, BTW, do things much better anyway, because they are "real" languages.

    61. Re:At this rate... by dargaud · · Score: 1

      Too bad it got dumped in Vista. I've heard it will be included in service pack 1 though.
      So where do you get this PowerShell ? Next version of Vista, already installed somewhere hidden in XP ? Separate free download ? Payware ? Server versions of the OS only ?
      --
      Non-Linux Penguins ?
    62. Re:At this rate... by Anonymous Coward · · Score: 0

      Instead they probably spent millions of dollars on crap that's just going to be compared (unfavorably) to the shells in Cygwin and *nix.
      Only by people who have never actually tried it.
    63. Re:At this rate... by Anonymous Coward · · Score: 0

      It is only the final output that has to be human readable, and printing whatever data is absolutely not a problem. The object-orientation just makes all the intervening steps that more simpler. (PowerShell has all the text-parsing tools you could want, and more. Remember that all strings are objects too.)

    64. Re:At this rate... by trashbat · · Score: 1
      Don't need PowerShell for that, either:

      @echo off
      rem Renames "file.%1" to "file.%2"
      ren *.%1 *.%2
    65. Re:At this rate... by ray-auch · · Score: 1

      That was because they _needed_ a script so they could do:

          renamefiles txt jpg

      on the commandline.

      On windows you don't need the script at all - just type the command

          ren *.txt *.jpg

      Why would you write a whole script to save typing a couple of * characters on the commandline ?

    66. Re:At this rate... by jonadab · · Score: 2, Funny

      > remember, there are *still* copy/paste problems between some toolkits..

      That's mainly because the stubborn GUI writers refuse to support the Emacs kill ring.

      Ahem.

      --
      Cut that out, or I will ship you to Norilsk in a box.
    67. Re:At this rate... by fuliginous · · Score: 1

      I suppose any shell in which you can easily use a range of scripting languages and have them communicate counts.

      So to me it would be fair to say that bean shell, ruby, python, booish all fit the bill. In fact Iron Python and Booish really qualify as they open up use of all the facilities of the CLR.

    68. Re:At this rate... by jimstapleton · · Score: 1

      I tried to link to a python shell web page, but for some reason the link didn't stick...

      but there are python based shells and perl based shells.

      --
      34486853790
      Connection too slow for X forwarding? Try "ssh -CX user@host"
    69. Re:At this rate... by CarpetShark · · Score: 1

      $ python

      $ iruby

    70. Re:At this rate... by Tim+C · · Score: 1

      The shell is a text interface

      No, the Unix shell is a text interface, but there's no fundamental reason why it has to be that way. Don't get me wrong, it works, but having used it for more than 10 years now I can certainly appreciate its limitations as well as its strengths. It remains to be seen how effectively something like PowerShell addresses those limitations, and whether it diminishes or removes any of the strengths in the process.

    71. Re:At this rate... by Anonymous Coward · · Score: 0

      I'll be first in line when it runs on a decent OS.

    72. Re:At this rate... by arth1 · · Score: 1

      Actually, yes, because there's no ambiguity at the time you write the scripts -- it's when new functions are added to the system that the abbrevs become ambiguous, and your system is now hosed because the scripts now refuse to run.

      FWIW, at least one well-known shell had this "functionality", but it was removed when the truly nasty side effects were discovered. Microsoft (or the Monad guy) is re-inventing the square wheel here. It's excellent for parking on hills, I grant you...

    73. Re:At this rate... by JayClements · · Score: 1

      Google "The Berkeley Utilities V2.0"; free DOS ports of Unix

    74. Re:At this rate... by gomoX · · Score: 1

      As much as I love python, I have seen stuff like PySH and it looks like crappy bash. I don't think Python is well suited for a shell because of the space-sensitiveness issue. Bash sucks for a programming language, though. Writing bash scripts feels like writing CSS for IE. Some other scripting languange should take its place.

      --
      My english is sow-sow. Sowhat?
    75. Re:At this rate... by jimstapleton · · Score: 1

      actually, it wasn't PySH, it was:
      http://ipython.scipy.org/moin/

      Which is IPython (not to be mistaken for iPython, Steve Job's variant of Python!)

      --
      34486853790
      Connection too slow for X forwarding? Try "ssh -CX user@host"
    76. Re:At this rate... by fitten · · Score: 1

      First, that's a poor definition of "object" - second, I can pass non-text data from one function to another with no prob.


      Yes, you absolutely can. One difference, though, is that passing 'objects' also lets you pass behaviour, along with that non-text data, from function to function in the shell.
    77. Re:At this rate... by Jarth · · Score: 1

      hihihihi, that look just like bash, ooooh

      OR AH, well, DARN, you weren't being sarcastic weren't yah?

      --
      free dom(inion) - free energy - free your mind - whee!
    78. Re:At this rate... by misleb · · Score: 1

      So I gave PS a try yesterday and my first impression is that it misses the mark of what a commandline is "supposed to" be. It was far too much like using a programming language. It is also very verbose. It helps that 50 or so basic commands have aliases but geez, too much typing (who'd a thought I'd ever been saying that about Windows). Regarding access to the registry as a filesytem.. well, it is STILL cryptic as heck. It is obviously not designed to be interacted with by users OR admins. And this hints at a much more fundamental problem that I think make Windows difficult to manage from a commandline: It just isn't designed to be accessed that way. PS, while clearly having some advantages over regular "dumb" unix scripting, almost seems like too little too late. In the PowerShell I didn't feel like I was really "inside" the system. I was in some programming sandbox. And finally, it feels like, yet again, Microsoft is trying to write a single tool that does everything. I still like the Unix theme (with the exception of Emacs) of having small tools that do one job efficiently and effectively.

      Then again, I freely admit that I'm biased. PowerShell has a LOT that is has to overcome I mind before I take it seriously. This isn't an anti-MS thing and it isn't political: I just hate Windows. I hate using it. I hate administering it. I hate the way it is designed. I hate looking at it. I'm just not likely to make a serious effort at learning PowerShell. The only thing that would make me really try to use it is if my employer switched to Windows across the board. And even then, I'd probably quit first.

      Oh well, maybe I'll get around to playing with PowerShell some more. Who knows,I might have some kind of epiphany or something. But for now I just say "meh."

      -matthew

      --
      "THERE IS NO JUSTICE, THERE IS ONLY ME." -Death
    79. Re:At this rate... by misleb · · Score: 1

      But at least Unix has cut, awk, and sort; what I haven't seen anyone write about yet is whether Windows Power Shell has anything like those utilities, or the scores of other utilities that make a shell useful. The entire Unix command-line suite, reworked with consistent syntax, would be nice.
      --


      You can get those programs for Windows. That isnt' the issue. The issue is that there is very little on a Windows system that will benefit from them. It is like when I complain to Windows using friends that there is no decent commandline (before PowerShell), they just say "download bash and the cygwin tools." Uh, yeah, ok. Then what? I still have a system that, in a very fundamental way, is not designed to be manipulated that way. Normally you 'cut' some text from one program and pass it onto another program as an argument or something like that... what are you going to pass the results of cut to in Windows?

      -matthew
      --
      "THERE IS NO JUSTICE, THERE IS ONLY ME." -Death
    80. Re:At this rate... by Anonymous Coward · · Score: 0

      > Why would anybody want to run pine from within a scripting language that already has IMAP, mailbox, rfc822 and smtplib modules?

      Maybe they want to actually read their email.

    81. Re:At this rate... by jhol13 · · Score: 1

      Quite often some of the intermediate results are interesting, either for debugging, backup or other reasons.
      And if you do not need the intermediate at all then why limit yourself to a shell, why not pick a real programming language? What is the point of the shell?

    82. Re:At this rate... by Anonymous Coward · · Score: 0

      Then you've never seen MPE/iX.

    83. Re:At this rate... by misleb · · Score: 1

      I don't get it, what good are those projects if all your applications just import/export raw text or binary? How does osh help me manipulate log files, for example, if they all hve different formats?

      -matthew

      --
      "THERE IS NO JUSTICE, THERE IS ONLY ME." -Death
    84. Re:At this rate... by I'm+Don+Giovanni · · Score: 1

      PowerShell is a free download.
      It's available for 32 and 64 bit versions of Vista, XP, Windows Server 2k3, and Longhorn Server.
      http://www.microsoft.com/windowsserver2003/technol ogies/management/powershell/download.mspx

      (There's old text at that link saying that the Vista version is at RC2, but it's actually RTM.)

      --
      -- "I never gave these stories much credence." - HAL 9000
    85. Re:At this rate... by Anonymous Coward · · Score: 0

      Overrated?

    86. Re:At this rate... by Anonymous Coward · · Score: 0

      It also allows shortcut versions of commands so you don't have to type the entire "wordy" version of the command.


      What the heck is with all the lazy people who feel that an arcane "shortcut" version of a command is better than a fully expanded one?

      It's one of the very few things that I really hate about Unix.

      Why "rm" instead of "remove"?
      Why "cd" instead of "changedir"? And especially why have "cd", and "mkdir" and "rmdir" instead of "md" and "rd"?

      Sure, after a while these become second-nature...but why impose the learning curve at all? Typing is really not that hard a skill to pick up...and IMHO expanded versions of commands are a heck of a lot easier to read than acronyms.

  5. It's amazing people still use windows. by CastrTroy · · Score: 0, Troll

    Every time I use Windows, I find it amazing that people still pay for and use MS software. It's pretty good, but it seems to be missing a lot of key features. Things like the shell are decades behind unix. I can't even take a picture and scale it to fit on the desktop without the aspect ratio being messed up. I can't stand using IE, even IE7 because it's behind where firefox was 2 years ago. 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.

    --

    Anthropic principle: We see the universe the way it is because if it were different we would not be here to see it.
    1. Re:It's amazing people still use windows. by SlashSquatch · · Score: 1

      Image Magick tools run fine under windows in a pinch.

      --
      Autonomous Retard -- Is your camp safe? UnsafeCamp.com
    2. Re:It's amazing people still use windows. by Anonymous Coward · · Score: 0

      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


      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? ;)
    3. Re:It's amazing people still use windows. by QCompson · · Score: 3, Funny

      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!
    4. Re:It's amazing people still use windows. by PadRacerExtreme · · Score: 2, Insightful

      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.

      --
      Just remember - if the world didn't suck, we would all fall off.
    5. Re:It's amazing people still use windows. by MightyMartian · · Score: 1

      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.

      --
      The world's burning. Moped Jesus spotted on I50. Details at 11.
    6. Re:It's amazing people still use windows. by Ucklak · · Score: 1

      Doesn't work in XP.

      All my scripts that worked in Win2000 and 98 fail to work. Granted the image manipulation parts work but putting copies in different directories don't work.

      --
      if you steal from one source, that is plagiarism, if you steal from many, well, that's just research.
    7. Re:It's amazing people still use windows. by Ucklak · · Score: 1

      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.

      --
      if you steal from one source, that is plagiarism, if you steal from many, well, that's just research.
    8. Re:It's amazing people still use windows. by Anonymous Coward · · Score: 0

      Things like the shell are decades behind unix. Except that Powershell is more advanced than bash, ksh and even zsh, in one regard. Since 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.

      Once it becomes more widespread, Powershell is going to obsolete cmd.exe as the latter did to command.com. If you have to use Windows, I would start learning it immediately.
    9. Re:It's amazing people still use windows. by Anonymous Coward · · Score: 0

      If you don't need a shell, then you're not a power user.

      The 'Power User' role created by MS for their rights and roles templates is just an attempt reconcile their munged access permissions with some sort of account access.

      Very poorly done and nearly useless.

    10. Re:It's amazing people still use windows. by zappepcs · · Score: 1

      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.

    11. Re:It's amazing people still use windows. by CastrTroy · · Score: 2, Insightful

      Wrong. 90% of users don't need the old windows/msdos shell. If people had a shell that was as good as bash, then they would use it. As it is now, using the shell in windows doesn't provide any benefit, so nobody bothers to use it. You can't say people don't need a shell when they don't have one. It's like saying people didn't need macros in word processors before the existed. Nobody used macros because the option wasn't available to them. Now that macros are available, many people do use them, and not just the power users. MS assumes that everybody is an idiot, and therefore doesn't provide tools that people with the right skills would actually use. Therefore, nobody has the opportunity to develop skills with these tools. Take a look at some of the stuff in XP, like that search dog, and the dumbed-down control panel and management options. With features like that it's no wonder people don't learn anything about computers, when the computer assumes they don't.

      --

      Anthropic principle: We see the universe the way it is because if it were different we would not be here to see it.
    12. Re:It's amazing people still use windows. by eln · · Score: 1, Insightful

      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.

    13. Re:It's amazing people still use windows. by dknj · · Score: 1

      correct, there was already vbscript which can do everything and then some (even if the learning curve is akin to ripping off your eyelids...) while i haven't used powershell yet, i have not had a need to use it. the switch to powershell will eventually be made since longhorn server will include it. it should begin the end of the vbscript era..

    14. Re:It's amazing people still use windows. by ArsonSmith · · Score: 1

      1998 was the year of the linux desktop, at least for me it was. And I was a die hard Windows/Dos user before that. I had only passing exposure to Unix. December 10th 1998 my windows 95 died. I decided to install Linux Redhat 5.0 and never looked back. Unfortunately I am now stuck on a Mac.

      What is the meaning of this "The year of the Linux Desktop?"

      --
      Paying taxes to buy civilization is like paying a hooker to buy love.
    15. Re:It's amazing people still use windows. by Dr_Barnowl · · Score: 4, Insightful

      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 :-)

    16. Re:It's amazing people still use windows. by Anonymous Coward · · Score: 0

      Wrong!!! I know i cant be in a unique position, i, being a lonely geek, looks heavily at free porn, as well as makes downloads from the web and bittorrent. Now, i dare you to even open a directory containing a few (10+) thousand files (pictures), yea, less then a second on a shell, instant. Now, thats say i just downloaded a few thousand images (possible 20,000+) from bittorrent, and, surprise surprise, they are in .rar format. I dont know if you tried, but the unrar program in *nix is bizarre. You just cant say "unrar e ../downloads/newpornfrombittorrent/*", no, the unrar program only accepts one file at a time. This is a very good place to say, use the true power of the shell: "for i in ../downloads/newpornfrombittorrent/*; do unrar e $i; done" or something like that. Next, it sadly unpacked in multiple directories, even worse, the images are named such as "01.jpg", which means we couldent extract them to the same file, nore can we, we must rename all of them before we can even think about moving them. Now, if your dealing with thousands of images, ill just let you suffer in a GUI while you think about how your going to move them. In the meantime, renaming all the files is our task, which again, you GUI users can suffer. A small script that extracts the directory name, and uses "rename" to append the directory name to each file in its directory will suffice for our renaming purposes."for i in *; do cd $i; rename "" $i *; cd ..; done;", simple eh? Now, to move our files... please, like a few thousand files is anything to worry about? "find ./* -name .jpg|xargs mv --target-directory=../porn/images/sorted".

      Eh, i know i cant be a special user, ok, maybe organizing by porn is unique, i never asked so i dont know, but the point is: the shell, its not just for administrators, its for porn lovers to, what other users might also find the shell indispensable?

      word to type: passion .. so true.

    17. Re:It's amazing people still use windows. by ArsonSmith · · Score: 2, Insightful

      Saying you don't need a shell just means you have found clunky, typically inefficient workarounds, or you are just living without its benefits.

      Sure you can live without a vacuum cleaner, but your carpet and overall cleanliness is going to suffer for it. I know people who live in apartments without vacuum cleaners and they are very similar to computers who's users don't use or understand shells.

      --
      Paying taxes to buy civilization is like paying a hooker to buy love.
    18. Re:It's amazing people still use windows. by Delkster · · Score: 1

      Most people may not need a command-line shell, and power users may survive without one, but that doesn't mean it isn't a valuable part of a toolkit.

      In particular, a good command-line interface (such as those found in many unix variants) is much more flexible than any GUI I've seen so far. Its strength comes from the ability to combine several simple tools together to build up a more complex and powerful one. I often reach for the command-line when I want to do something to a number of different files, for example mass renaming, adding ReplayGain tags to audio files, or any number of other such things. Of course any one of these things can be done through a GUI, but the point to notice is that the command-line shell needn't be specifically designed for any such task -- it offers the possibility not through a specific feature implemented explicitly for that task but by offering a flexible collection of tools to be freely used and combined. Usually GUIs will do mostly just those things they were designed for.

      Of course, the things I use the command-line for could probably be done with a GUI even without a specific feature for the task, but it might well mean more manual work -- and power users don't like that.

    19. Re:It's amazing people still use windows. by MightyMartian · · Score: 1

      When you're putting together a good, *free* mail server or file sharing server, 3D acceleration doesn't count. It's the kind of guys putting together servers who are in the most need of good shells. The *nix shells, with chained pipes, just kicks the shit out of Microsoft's languages thus far. Some of the tools are a bit tough to learn (sed is a real nightmare, so I use awk), but I've done some pretty amazing things in bash, massaging nine or ten thousand item catalogs from some distributor's bizarre mainframe format into CSV files with a few lines of awk code. That's the kind of shell and shell tools that are needed; quick-and-dirty tools that don't try to do every goddamn thing possible, but rather do one thing and do it very well.

      --
      The world's burning. Moped Jesus spotted on I50. Details at 11.
    20. Re:It's amazing people still use windows. by Anonymous Coward · · Score: 0

      So maybe you should RTFA about the NEW IMPROVED ALL DIFFERENT windows shell before posting?

    21. Re:It's amazing people still use windows. by CastrTroy · · Score: 1, Informative

      What I'm saying is that for power users, Windows sucks because it doesn't provide any features geared towards them. I'm also saying that for non-power users it sucks, because you can't just put an image on your desktop, and have it resize to fit the screen automatically. You have to open it up in an image editor, resize it to your desktop, then put it on your desktop. I don't see what any particular person likes about windows, power user or not.

      --

      Anthropic principle: We see the universe the way it is because if it were different we would not be here to see it.
    22. Re:It's amazing people still use windows. by cant_get_a_good_nick · · Score: 1

      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.
    23. Re:It's amazing people still use windows. by nanosquid · · Score: 2, Informative

      Things like 3D acceleration are decades behind Windows.

      Actually, 3D acceleration in Linux is technologically ahead of Windows. What's behind is driver support, although that's coming around.

      People use Windows because most people are not looking for the same things in an OS that you are.

      Well, nobody in my family uses Windows anymore: they have all switched to either Mac OS or Ubuntu, both of which are considerably less hassle and overall cheaper.

    24. Re:It's amazing people still use windows. by HeroreV · · Score: 1

      Unfortunately I am now stuck on a Mac.
      Why? I'm assuming that by "on a Mac" you mean "using Mac OS". Is there something only available for Mac OS that you need?
    25. Re:It's amazing people still use windows. by lakeland · · Score: 1

      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!

    26. Re:It's amazing people still use windows. by Anonymous Coward · · Score: 0

      - Ease of use, much more than Linux
      - Even cmd is easier for most tasks
      - One thing to learn. The time I invest in learning bash is useless if I have to use an host with csh and so on.
      - If I'm a power user I might find the tools I need myself. If I'm a non-pu I don't even know what an aspect ratio is, beside on Linux if I'm not a pu I will probably never reach the desktop image selection in the first place.
      - Easy installation of apps (do not mention apt-shit. what if I - like 99% of the time - want an application not in the repository ?)
      - Consistent experience all-around.. like Ctrl+C/Ctrl+V working across all applications (whatever their GUI toolkit) and not require selection/middle-click gimmicks
      - Support of commercial apps.
      - Better support of hardware (Linux do not even install on my machine because of hard disk configuration; on Windows I must remove one HDD during install but for the rest it works. - we are not talking of driver (at least not ONLY of drivers)). It's the fault of my config ? I couldn't care less. If your favorite app stops working because of Vista you'll blame Vista and not the app whoever the fault is.
      - Backward compatibility. Binary.
      - The only thing I wasn't able to do on Windows as now is to configure CvsNT. The list of things I had major trouble and less than average success on Linux is infinitely long. Just thinking of sharing a folder or mounting shared folders (either through Samba or NFS) makes me crying (and then copying the same allow-all config file and pray noone does anything wrong).
      - Media support and DRM. Yes, I want to be able to buy music, so what ?
      - Legal and easy DVD playing ?
      - Easy multimonitor support (on X = hell)
      - Many more, just tired of writing points you'll bash down anyway

    27. Re:It's amazing people still use windows. by orclevegam · · Score: 1

      Just the other day I was using my 3D accelerated Beryl desktop, and playing Half-Life 2, and World of Warcraft in Linux, so remind me again what's decades behind? Incidently, Beryl is much better than Aero, I've seen and used both, and Beryl, if you're shopping for eye candy, is more functional, looks and behaves cooler, and is much lighter on the resource usage than Aero, but then again, it doesn't have to poll all your hardware and spy on your processes constantly to make sure you're not doing anything Microsoft isn't happy about.

      --
      Curiosity was framed, Ignorance killed the cat.
    28. Re:It's amazing people still use windows. by Anonymous Coward · · Score: 3, Informative

      in the specific case of diffing the contents of two directories, it's just
      $> diff --brief a/ b/

      It just seemed worth pointing out.

    29. Re:It's amazing people still use windows. by makomk · · Score: 1

      Just the other day I was using my 3D accelerated Beryl desktop, and playing Half-Life 2, and World of Warcraft in Linux, so remind me again what's decades behind?

      Unfortunately, the last time I tried it, Half-Life 2 sucked under Linux - particularly when you got underwater and the framerate became like a slideshow. That has very little to do with Linux's 3D support and a lot more to do with Wine's DirectX support, though. (Besides, who knows, they might've fixed it by now...)

    30. Re:It's amazing people still use windows. by lakeland · · Score: 1

      Cool! I'm certainly going to start using that :)

      " If both from-file and to-file are directories, diff compares corre-
                    sponding files in both directories, in alphabetical order; this compar-
                    ison is not recursive unless the -r or --recursive option is given.
                    diff never compares the actual contents of a directory as if it were a
                    file. The file that is fully specified may not be standard input,
                    because standard input is nameless and the notion of ''file with the
                    same name'' does not apply.
      "

      Amazing - I've been using diff for hmm, over a decade now, and I don't remember the last time I read the man page...
      Like I noticed a couple weeks ago that, since the last time I've read its man page, rsync has added a 'search for similar files with similar but different names option.

    31. Re:It's amazing people still use windows. by suv4x4 · · Score: 1

      90% of users don't need the old windows/msdos shell. If people had a shell that was as good as bash, then they would use it. As it is now, using the shell in windows doesn't provide any benefit, so nobody bothers to use it.

      Oh 90%! Just like those 90% of statistics that are made up on the spot. What a coincidence.

      - A heavy windows shell user

    32. Re:It's amazing people still use windows. by Anonymous Coward · · Score: 0

      How about?

      diff <(ls a) <(ls b)

      It's less disgusting I think.

      Oh, and about all this everything is an object. Smalltalk is pushing 40, why not re-discover it?

      http://www.squeak.org/

    33. Re:It's amazing people still use windows. by Grishnakh · · Score: 1

      Because so many commercial apps are Windows-only, duh.

      Any more stupid questions?

    34. Re:It's amazing people still use windows. by Anonymous Coward · · Score: 0

      Come on... Windows sucks because it doesn't automatically re-size a desktop photo? What... Are you on glue? Who cares? Who really gives a damn about an action that most people will do once and then forget that they even did. I mean, it must take like... oh... 2 seconds to right click on the desktop and select stretch in a sub menu. Oooo, that's tough to do! Windows must suck bad! It doesn't do it automatically! Jesus Christ, F$&^ing FanBoy, get a grip on reality.

    35. Re:It's amazing people still use windows. by TrancePhreak · · Score: 1

      Actually, 3D acceleration in Linux is technologically ahead of Windows. What's behind is driver support, although that's coming around.
      This doesn't make sense, care to explain?
      --

      -]Phreak Out[-
    36. Re:It's amazing people still use windows. by hey! · · Score: 1

      The questoin is not whether an OS feature is used by users.

      The question is does the existence of a feature make an operating system more useful.

      There is no question that scripting makes Windows more useful. The problem is that Windows scripting is so bad that its contribution to Windows utility is artificially limited when compared to Unix, and especially MacOS.

      --
      Post may contain irony: discontinue use if experiencing mood swings, nausea or elevated blood pressure.
    37. Re:It's amazing people still use windows. by techmuse · · Score: 1

      OS X's Automator does exactly this...

    38. Re:It's amazing people still use windows. by vegmotorcycle · · Score: 1

      IBM tried to kill Windows so people would use OS/2. Microsoft took a huge risk by taking on IBM. I've tried using Linux for years, and it's still a terrible user experience. Any modification of your hardware is horrible. Windows usually picks up the change and just works. Linux is much better than it used to be, but it still can't compare to the setup experience of Windows.

    39. Re:It's amazing people still use windows. by lakeland · · Score: 1

      yep, and there is a port of lisp to be a shell in unix too but it doesn't quite work as a shell replacement.
      Could you imagine using smalltalk as your shell?

    40. Re:It's amazing people still use windows. by ArsonSmith · · Score: 1

      Yea, stupid VPN for work is set to only allow Windows and OSX. No actual technical reason a declaration of "This is what we support" Been on it now for almost a year.

      --
      Paying taxes to buy civilization is like paying a hooker to buy love.
    41. Re:It's amazing people still use windows. by eklitzke · · Score: 1

      Sorry, but Linux does _not_ have 10% of the desktop market -- not even close. I know a lot of people who "use" Linux. Meaning that they installed a random distribution on their computer a long time ago, figured out how to get GRUB to default to the Windows entry, and then promptly forgot about the Linux installation that they couldn't get working properly.

      I'm sure that a lot of computers have Linux installed on them, but I'd be surprised if even 5% of desktop users use Linux on a day to day basis. There are quite a few people using Linux casually, like the barmaids you described or my roommate's family, but who happened to run into some nerd who could install it for them (or convince them to install it themselves), but by far most of the users are still geeks. And since most of the geeks who "use" Linux don't actually use it enough to be considered Linux users (not in my mind, anyway), I'm still convinced that only a very small minority of computer users run Linux.

      --
      #include ".signature"
    42. Re:It's amazing people still use windows. by serviscope_minor · · Score: 2, Informative

      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.


      Yes that is disgusting. Fortunately, you're not the first person to notice this. Try this instead:

      diff <(ls a) <(ls b)

      There is a similar syntax for outputs as well. It's not perfect: you can't easily generate a general directed graph, but in that case, you would probably get deadlocks anyway, since programs tend to read files in order.

      --
      SJW n. One who posts facts.
    43. Re:It's amazing people still use windows. by kabz · · Score: 1

      Try this:

      1. Install and use Windows XP for a while.
      2. Image the drive into a VM.
      3. Boot up VM.
      4. ??? (Cannot run, please activate this copy of Windows)
      5. Install Ubuntu.

      Seriously, nothing concentrates the mind like the threat of being able to access your applications and data after a HD crash.

      Even Apple *get* this. I imaged my Mac Mini with all my data onto my iMac. Worked great. Nothing like the security of having a backup image ready to go in the event of a HD crash.

      --
      -- "It's not stalking if you're married!" My Wife.
    44. Re:It's amazing people still use windows. by Anonymous Coward · · Score: 0

      Linux doesn't have the resources that Microsoft had to get it polished to the current level. So, one reason OSS is superior to proprietary software is because anyone in the world can contribute to it, thereby allowing the increase of OSS's resources beyond that of any corporation unless that corporation is Microsoft? Gawd damn you Bill Gates, you win again!

      And mind your damn verb tenses!
    45. Re:It's amazing people still use windows. by Anonymous Coward · · Score: 0

      Ohhh that explains why I play all my games on Ubuntu at roughly the same frames of Windows XP. As long as you have a nvidia for linux you are good to go for Oblivion, UT2004, CS, Half Life 2, so on so forth. ATI works but not as well. Both Windows and Linux have their advantages but I prefer Linux due to the open-source. Most Linux users aren't big power overclockers and gamers like me but most games run just as well as on Linux once you take time to learn how.

    46. Re:It's amazing people still use windows. by durkster · · Score: 1

      I had to help a friend with a cmd routine on XP to help him rename and resize a very large number of images, in the end I had to go beyond MS and use mtr ( minitrue)combined with irfanview cmd line. dir /b | mtr -o -x+ - (.*)(Picture" ")(.*)\r = 'ren "\1\2\3" "%num%\3"\r>run.cmd dir /b | mtr -o -x+ - (.*)(DSCF*)(.*)\r = 'ren "\1\2\3" "%num%\3"\r>>run.cmd call run.cmd del run.cmd i_view32.exe %dest%*.jpg /resize=(%PictWidth%,%PictHeight%) /aspectratio /DPI=(%ThumbDPI%,%DPI2%) /jpgq=%PhotoQuality% /convert="%big%$N.jpg" i_view32.exe /killmesoftly i_view32.exe %dest%*.jpg /resize=(%ThumbWidth%,%ThumbHeight%) /aspectratio /DPI=(%ThumbDPI%,%ThumbDPI2%) /jpgq=%ThumbQuality% /convert="%thumb%$N.jpg i_view32.exe /killmesoftly

    47. Re:It's amazing people still use windows. by Anonymous Coward · · Score: 0

      % mkfifo /tmp/lsa
      % mkfifo /tmp/lsb
      % ls a > /tmp/lsa &
      % ls b > /tmp/lsb &
      % diff /tmp/ls{a,b}

      Nono..

      % diff \(ls a) \(ls b)
      man diff

    48. Re:It's amazing people still use windows. by Anonymous Coward · · Score: 0

      Unfortunately Beryl is still buggier than a corpse in the jungle. It's pretty sweet though, I look forward to the re-merged compiz. Normal compiz has been rock-stable for me so far.

    49. Re:It's amazing people still use windows. by goarilla · · Score: 1

      what's the point of the named pipes?
      aren't those mkfifo's redundant since your lsa and lsb will be created in CWD and not in dir a/ or dir b/?
      i just don't get the point but i do admit i really don't use named pipes that often so i have no clue about when, how or why one would use them

  6. Don't knock it until you try it by PhrostyMcByte · · Score: 4, Interesting

    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.

    1. Re:Don't knock it until you try it by TBone · · Score: 5, Informative

      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.

      Unless MS rewrites all of their other commands to accept STDIN/OUT, Monad will never surpass the shells. The power of the shells isnt' their programming flexibility, it's their ability to incorporate all the other UNIX tools and commands via pipes to do what you want.

      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.

      Another reason it will never surpass the shells. They're lightweight, and flexible, and I don't need a Garbage Collector running in the back end to clean up my object allocation.

      --

      This space for rent. Call 1-800-STEAK4U

    2. Re:Don't knock it until you try it by Anonymous Coward · · Score: 0

      but I would not be surprised to learn Powershell equals if not beats bash at the shell game

      Blasphemy !!

      :-)
    3. Re:Don't knock it until you try it by immovable_object · · Score: 2, Informative

      HAHAHAHAHAHAHA. Thanks! I needed a laugh today, and saying that a shell can use up to a gig of memory provided that laugh.

      Let's see on my Mac with OS X, my bash shells, which admittedly aren't being used semi-heavily, are using:

      USER PID %CPU %MEM VSZ RSS TT STAT STARTED TIME COMMAND
      nobody 879 0.7 -0.0 27816 856 p3 Ss 11:06AM 0:00.12 bash
      nobody 281 0.0 -0.1 27816 1472 p1 S+ 11:09PM 0:00.17 -bash
      nobody 348 0.0 -0.0 27816 904 p2 S+ 11:37PM 0:00.16 -bash


      Hmmm... that comes to an average of 1078kb of memory per shell. And PowerShell can use up to a GIGABYTE?

      I'm still laughing.

    4. Re:Don't knock it until you try it by mangu · · Score: 1
      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.


      Well, you'd be surprised to learn that bash isn't even the tip of the iceberg in Linux. There's also sh, csh, ash, dash, ksh, and I don't know how many other shell options I can't recall just now.


      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


      WOW! And some people prefer to use dash because they complain that bash uses up to 1MB of memory in Linux! Boy, I'm glad I switched to Linux ten years ago and convinced my managers it's the best option for my work...

    5. Re:Don't knock it until you try it by HappySmileMan · · Score: 0

      Well first of all as you say you have no experience with BASH so can't compare... And while I can't disagree because I haven't used the powershell (and don't intend to)...

      If a shell needs 1GB of RAM with "semi-heavy" usage it can't really be compared to BASH, especially since I can have 5-6 full-screen shells and a lot of windows open on my 512MB Kubuntu, and still not have to touch the swap

    6. Re:Don't knock it until you try it by MightyMartian · · Score: 1

      If it's the case that the new shell takes up that much memory, then Microsoft has completely missed the boat. Why the hell would I want, say, my scheduled tasks running in a resource hog like that? K-rist, but I might as well use Python or PHP, and get full-blown languages, and I'll wager an instance still wouldn't come close to that.

      --
      The world's burning. Moped Jesus spotted on I50. Details at 11.
    7. Re:Don't knock it until you try it by seaturnip · · Score: 0, Flamebait

      Unless MS rewrites all of their other commands to accept STDIN/OUT, Monad will never surpass the shells. The power of the shells isnt' their programming flexibility, it's their ability to incorporate all the other UNIX tools and commands via pipes to do what you want.

      You're obviously just parroting Unix ideology and haven't even bothered to take a glance at Monad to see how it compares. As I understand it, Monad's object model is essentially a superset of Unix's file model. I haven't used it enough to speak to how it works in practice, but it is a fundamentally more powerful paradigm.

      Another reason it will never surpass the shells. They're lightweight, and flexible, and I don't need a Garbage Collector running in the back end to clean up my object allocation.

      That's what they said about the early versions of Java. Now C++ is relegated mostly to embedded, systems and games programming.

    8. Re:Don't knock it until you try it by PhrostyMcByte · · Score: 0

      Unless MS rewrites all of their other commands to accept STDIN/OUT, Monad will never surpass the shells. The power of the shells isnt' their programming flexibility, it's their ability to incorporate all the other UNIX tools and commands via pipes to do what you want.

      You'll be happy to know one of the major points of Powershell is the ability to pipe objects through all of their various commands. It's nice to finally have a usable shell, but god damn it is overdue.

      I'd be interested to know why people are modding my post down :) Is the suggestion that a Windows shell might finally equal bash flamebait now? Or maybe I didn't list enough of Powershell's faults - I should have just left out the complements to it to appease the anti-Microsoft folks. If someone who has actually used Powershell beyond what cmd.exe can already do would like to rebut something I said, please do! *ducks*

    9. Re:Don't knock it until you try it by Jartan · · Score: 0

      Unless MS rewrites all of their other commands to accept STDIN/OUT, Monad will never surpass the shells. The power of the shells isnt' their programming flexibility, it's their ability to incorporate all the other UNIX tools and commands via pipes to do what you want.


      It still uses normal pipes. The "objects" it passes are just XML text streams from what I understand. They will have no problem using all the currently existing UNIX tools. In fact I'd be stupified if new tools aren't created to format common UNIX tools output into XML streams and vice versa.

      Some people will love this new idea and even incorporate it on the UNIX side of things. I'm not sure if I agree with the idea of using XML for this purpose but I'll give kudos to MS for bucking UNIX's crappy old model and trying to improve it even if they end up failing.
    10. Re:Don't knock it until you try it by arevos · · Score: 4, Informative

      Unless MS rewrites all of their other commands to accept STDIN/OUT, Monad will never surpass the shells. The power of the shells isnt' their programming flexibility, it's their ability to incorporate all the other UNIX tools and commands via pipes to do what you want. Powershell doesn't use pipes in the same way shells do in unix. Powershell communicates via remote methods and objects, and a lot of the Windows API has been exposed to it, so there's quite a lot of things you can do with it, and a few things that would be a lot more difficult to do with text streams and pipes. It's also quite logically put together, much more so than the standard unix set of command tools. There's not as many third party apps, but most of the basics are there.

      It really fails in two places. Firstly, it's slow. You wouldn't have thought it possible for a command shell to be that slow, but it is. It's so slow it was actually quicker for me to use explorer. It is god-awfully, mind-bogglingly slow.

      The second problem is that it had no easy way of being accessed over a network link, last time I looked at it. So there's no chance of SSHing into a Windows box and administrating it from there, at least not without fiddling with a lot of hacks and workarounds I couldn't get to work.

      The other place where unix shells have an advantage over Powershell is in there interface, as Powershell is currently quite basic in that department. There's limited tab completion and a prompt that can be altered (like PS1 under sh derivitives), but not much over that. Certainly nowhere near my personal favourite, Fish.

      Another reason it will never surpass the shells. They're lightweight, and flexible, and I don't need a Garbage Collector running in the back end to clean up my object allocation. Why so closed-minded? Powershell has a lot of interesting ideas, and an architecture that's structurally very well organised. Don't dismiss it just because it was made by Microsoft, especially since it sounds as if you haven't even tried it out.
    11. Re:Don't knock it until you try it by nine-times · · Score: 1

      I remember one idea that Microsoft was talking about with Monad that actually sounded like a noteworthy innovation-- but I don't know if it still exists. They claimed that any program developed for Vista or Longhorn would have all of their GUI elements automatically scriptable. This seemed potentially useful since I actually have a lot of Windows programs that I have to use for highly repetitive tasks, and I have to use special automation software to accomplish this.

      Microsoft's command-line certainly needed to be overhauled in order to be useful for scripting, and I might imagine some ways that I'd like to see bash changed, but that doesn't excite me too much. The idea, however, of all Windows programs automatically having their functions controllable through a command-line actually seemed like something worth mentioning. Does Powershell have this functionality?

    12. Re:Don't knock it until you try it by nanosquid · · Score: 1

      If someone who has actually used Powershell beyond what cmd.exe can already do would like to rebut something I said, please do!

      I think you're missing the point: more (data types, commands, options, features, etc.) are not necessarily an advantage in a shell. The UNIX shells hit a sweet spot between scripting and interactivity. Three decades of practical experience and evolution have gone into it. Along the line, people have tried all sorts of thing (object oriented shells, XML shells, etc.), and, given a choice, people always went back to the UNIX text shells.

    13. Re:Don't knock it until you try it by Anonymous Coward · · Score: 0

      My biggest hangup after using it for a while is how "powerful" it is. It strikes me as (essentially) command line / scriptable object oriented vb.net. I'm a sysadmin, I can't program for squat. The chances of me actually _remembering_ any commands in this thing, let alone being able to use it swiftly and regularly are pretty slim.

    14. Re:Don't knock it until you try it by Anonymous Coward · · Score: 0

      "Powershell is very powerful. Much more so than cmd.exe."

      Dude. My 2 year old daughter is much more powerful than an amoeba, but I still wouldn't put her in a steel cage deathmatch with a baby panda.

    15. Re:Don't knock it until you try it by ivan256 · · Score: 2

      In fact I'd be stupified if new tools aren't created to format common UNIX tools output into XML streams and vice versa.


      I'm stupified that anybody would find value in that. The shells ferry data around. They themselves generally don't need to or have any business actually understanding that. They funnel it to other commands to deal with that. Wrapping of common utilities output in XML is a ridiculous exercise in buzzword compliance that could only possibly help people who are dealing with unstable utilities (in the "change a lot" sense, not the "crash a lot" sense). No wonder it eats so much memory.
    16. Re:Don't knock it until you try it by maxume · · Score: 2, Insightful

      The down mods are because the moderation system barely works. My impression is that there are plenty of people with mod points who see them as rewards/penalties rather than a mechanism for making the conversation more readable. The hair pulling insanity of it is that it is among the better systems out there.

      As far as Powershell, why worry too much about what people who haven't used it think?

      --
      Nerd rage is the funniest rage.
    17. Re:Don't knock it until you try it by Waffle+Iron · · Score: 1

      Hmmm... that comes to an average of 1078kb of memory per shell.

      Apparently, some people still aren't satisfied. The first entry under the BUGS section of the bash manpage reads: "It's too big and too slow."

    18. Re:Don't knock it until you try it by kc01 · · Score: 2, Insightful
      "Powershell is very powerful. Much more so than cmd.exe."


      One would certainly hope so, considering how old and antiquated MS-DOS and cmd are. I mean, come on. How could it NOT be? I looked at the user guide for powershell, and saw that "Windows PowerShell is based on the .NET framework."
      There's a strike against it right away.

      I've been programming command languages for four decades now, and of course there will be unique features to the command language for any operating system. For example, the DCL on the VAX and the CCL on NOS naturally won't interchange on the computers. But times have changed- With the ability to run perl and other open tools on any system, why make something as obtuse as Powershell?

      Let's look at an example command "Get-PSDrive -PSProvider FileSystem." Even with command completion, this looks cumbersome as hell. Kinda reminds me of COBOL. Computers and their programs are supposed to do the work, while reducing the work for the users.

      Read the manual, THEN knock it.

    19. Re:Don't knock it until you try it by Goalie_Ca · · Score: 1

      Otherwise you end up with a python console!

      --

      ----
      Go canucks, habs, and sens!
    20. Re:Don't knock it until you try it by osu-neko · · Score: 2

      Well, you'd be surprised to learn that bash isn't even the tip of the iceberg in Linux. There's also sh, csh, ash, dash, ksh, and I don't know how many other shell options I can't recall just now.

      zsh! Of course, I use zsh under MacOS X and under Windows (cygwin) as well as under Linux (and in fact have done all three within the last hour). It's great having a consistent user interface between all the operating systems I continually use. :D

      Since when did what shell you use become fodder of OS wars? It's just an application that runs under the OS, has nothing to do with the OS itself...

      --
      "Convictions are more dangerous enemies of truth than lies."
    21. Re:Don't knock it until you try it by Mia'cova · · Score: 1

      PowerShell passes objects. Legitimate instantiated objects. To the best of my knowledge, it does not serialize to XML, pass, then deserialize. Any idea where you read that?

    22. Re:Don't knock it until you try it by OzRoy · · Score: 1

      That is indeed how things are starting to go with MS products. Exchange 2007 is fully scriptable. The GUI is really nothing but an interface on top of the PS commands. Whenever you do anything in the gui it tells you what PS commands it executed.

      A lot of it's functionatly can't even be done through the GUI any more. For example to enable an imap mailbox for a specific user you need to execute the PS command
      set-casmailbox username -imapenabled $true

      It's stuff like this that makes the complaints I read earlier about the | not piping plain text through stdin and stdout like bash does a moot point. Why execute new processes that needs to parse text when you can just interface directly with the application and modify it's settings through a real programing interface?

      Take a look at this comparison of a bash script, and PS script here:
      http://blogs.msdn.com/powershell/archive/2007/01/2 9/virtual-machine-manager-s-powershell-support.asp x

    23. Re:Don't knock it until you try it by hackstraw · · Score: 1

      Unless MS rewrites all of their other commands to accept STDIN/OUT, Monad will never surpass the shells.

      There are other things that make *NIX commands kick but.

      Standard exit values from the programs. 0 on success, and other things on error. Also, there is STDERR.

      Don't get me wrong, compiled code and scripting languages have rolls too, but the *NIX shell, ascii text configuration files, and all of that jazz just makes *NIX work.

      In 2007, operating systems have come down to basically 2 flavors. *NIX and Windows. And every year, Windows gets a little more *NIX-like. Now, does it seem strange that in 2007 we are still stuck with a late 1960s early 1970s implementation of how to interface with a computer? Sure it does. But I simply don't know of a better way to interface with a computer, and apparently nobody else does either -- yet.

      Granted, I haven't seen Vista, but I'm sure I'll click around in it at a public computer or something some time in my life, but it just seems like yet another version of Windows, so I'm not interested. To be honest, I'm not that interested when a new OS X, Linux, Solaris or whatever new *NIX variant comes out either, but I know I can take one of those OSes and figure out their subtle differences, and move on. At work, some people still use Windows, and its a big deal when Vista or whatever comes out. It takes planning and meetings and money and validation and all of this jazz, but when a new *NIX comes around, we just install it, tweak a few things, and life goes on. Its no big deal.

      I would love for someone to come up with something better than *NIX, but I simply haven't seen anything come close enough to warrant any change.

    24. Re:Don't knock it until you try it by ningjing · · Score: 1

      I have checked both out and PowerShell has one, and only one advantage over bash, ksh, et. al. and that is it's object orientation (which is actually quite awesome). Everything else that is 'cool' about it has been out in *nix shells for, oh, maybe 20 years ;-) I expect object orientation will show up in *nix shells sometime soon ( even though it isn't trivial ). As for the memory issue, well what do you expect with MS, lean, mean, coding?

    25. Re:Don't knock it until you try it by nine-times · · Score: 1

      A lot of it's functionatly can't even be done through the GUI any more.

      That doesn't sound like a great idea to me. Personally, I want access to as many settings as possible through both CLI and GUI. When it's all CLI, you have to track down the appropriate commands and the correct syntax, and often the documentation isn't clear enough so there's a lot of trial and error involved. When it's a GUI, it's hard to automate and requires a remote GUI for remote administration.

      Isn't it about time we had the best of both worlds? Like standardized config files that can be edited through a text editor, a CLI, or a GUI? I've never understood why that was such a difficult concept.

    26. Re:Don't knock it until you try it by OzRoy · · Score: 1

      Power users want so many features in all their server applications that if you were to put all of them into a GUI the GUI would become so difficult to use to be rendered almost usless. So you leave the most common activities in the GUI keeping it simple, and then as you become more experienced and need the advanced options you learn the shell.

      I don't really understand why people seem to think a GUI is the be all and end all of intuitive user interfaces. It's not. It's very unintuitive. In many ways a command line can be easier and quicker. All admin work I do on linux is done through the command line. Powershell makes this possible for Windows servers as well. The command line only version of Longhorn will actually have a purpose because everything on Windows will now be able to be done through the command line.

    27. Re:Don't knock it until you try it by nine-times · · Score: 1

      I don't really understand why people seem to think a GUI is the be all and end all of intuitive user interfaces. It's not. It's very unintuitive. In many ways a command line can be easier and quicker.

      "Quicker and easier" is not the same as "intuitive". GUI isn't the end-all be-all of UI, but it has its advantages for finding settings that you don't use often or haven't used before. Even if the GUI is essentially a long list of check-boxes and drop-boxes to give you all the possible options, it allows you to quickly ascertain what settings are available and what choices are possible for each setting in a succinct form. To do the same thing with a CLI often involves reading several pages of text, talking to someone who is familiar with the tool, and/or looking up best practices and pitfalls online.

    28. Re:Don't knock it until you try it by OzRoy · · Score: 1

      I never said Quicker and easier was the same as intuitive, I just said that a GUI is not necessarily intuitive, especially if all the options are there. Just because it's displayed on a GUI doesn't tell you what it does, and often requires reading several pages of text. What the hell do you put in the box that is labeled "Unified Messaging Dial Plan"? Besides, the PS command line can give you ALL the options if you want it. get-mailbox -identity bob.smith | format-list That will get you the mailbox of bob.smith and will give you a list of all the settings that can be manipulated. Want something more general? Try 'get-command', although that will return a lot of stuff, so you can be a bit more specific by trying 'get-command get-*' to return only a subset of commands.

  7. Monads are windowless, get it? by Brunellus · · Score: 5, Interesting

    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.

    1. Re:Monads are windowless, get it? by clamantis · · Score: 2, Insightful

      "I wish they'd kept "monad" as the name." Hey, there's a name. WiSH!

    2. Re:Monads are windowless, get it? by suv4x4 · · Score: 1

      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.

      Why, what's wrong with WCLFFCSIOPCAU (Windows Command Line Framework For Creating Shell Input-Output Processing Commands And Utilities)?

      But if the community wants it strong enough, they've planned to rename it to SilverShell, and put this nonsense as a logo.

    3. Re:Monads are windowless, get it? by Anonymous Coward · · Score: 0

      tk_messageBox -icon question -type yesno -title "Re: Monads are windowless, get it?" -parent . -message "Wouldn't that conflict with the name of the TCL/Tk shell?"
    4. Re:Monads are windowless, get it? by Anonymous Coward · · Score: 0

      Well since the name choices were narrowed down early on to:

            ray shell
            prime shell
            monad shell

      Obviously this must have been to keep GNU from making an open-source version.

    5. Re:Monads are windowless, get it? by c0d3h4x0r · · Score: 1

      I wish they'd kept "monad" as the name.

      Yeah, because then the free GNU implementation of it could be called gonad.

      --
      Moderator hint: a comment is neither "Flamebait" nor "Troll" if it is true.
  8. Well, *that's* unique by Angst+Badger · · Score: 5, Funny

    Inconsistencies abound and everything is a special case.

    You should switch to bash and the GNU tools.

    Oh, wait.

    --
    Proud member of the Weirdo-American community.
  9. Powerful shell? Use REXX! by Anonymous Coward · · Score: 0

    If he wants a powerful shell program, he can go back and use OS/2 with its builtin REXX, or he can get an addon REXX for windows.

  10. Everyone should follow their lead... by Anonymous Coward · · Score: 5, Funny

    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.

    1. Re:Everyone should follow their lead... by Anonymous Coward · · Score: 0

      HA hah haha! mod-up parent Snarky +7

    2. Re:Everyone should follow their lead... by rmallico · · Score: 2, Informative

      take a look at wwww.nsoftware.com and look at their remoting capabilities... powershell scripts can be extended to add cmdlets for ssh, snmp, wmi, etc... no reason perl and bash and ??? could not be added as another snapin to extend things...

      another cool product is www.powergadgets.com for widget/gadget graphing on windows desktops...

      --
      sig goes here!
  11. Great Review by water-and-sewer · · Score: 4, Interesting

    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.

    --
    If this were Usenet, I'd killfile the lot of you.
    1. Re:Great Review by cmburns69 · · Score: 1

      Please keep your thoughts regarding your gonads to yourself. We don't want to hear them.

      However, I agree with your review of the review.

      --
      Online Starcraft RPG? At
      Dietary fiber is like asynchronous IO-- Non-blocking!
    2. Re:Great Review by sean4u · · Score: 1
      I think you mean:

      :s/M/G/
      the trailing g was superfluous, or even:

      FMrG
      or, and I learnt this just for you, because I thought it must be in there, and I just hadn't felt the need to know it before:

      brG
      And I agree too, though I haven't RTFGR, obviously.

      :wq troll.txt
  12. it's obvious by jcgam69 · · Score: 0, Troll

    Stop trying to fix windows and switch to linux. Windows is hopeless. If you can't run linux then you might as well end-it-all now, because you life is not worth living.

  13. Innovation at last! by Anonymous Coward · · Score: 0

    With their own NIH sudo and sh variants Microsoft are well on their way to reinventing unix.

  14. Powershell in Windows != Bash? by zukinux · · Score: 0

    Will I be able, within simple customization use my Bash scripting in Windows powershell ?
    Simple customization such as folder changing (if it's hard coded to /home/user folder, I will change it to c:\ or c:\documents and settings\user) only.
    If so, and Bash scripting might actually work, it would be great for me so I won't have to suffer while I'm using Windows, well, atleast not from the powershell... BSOD's Still disturb me :)

  15. What is wrong with Cygwin? by raphae · · Score: 2, Interesting

    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?
    1. Re:What is wrong with Cygwin? by FrnkMit · · Score: 1

      The problem I have is with pathnames. On my machine, Java, Ruby, and Emacs are compiled for Windows and use the 'c:\...' convention. Cygwin tools understand only forward slashes, and consider '/' to be 'C:/cygwin/' and 'C:\' to be '/cygdrive/c/'. So all my shell scripts have to convert paths, and I have to run Ruby scripts in CMD.COM because it can't find /cygdrive/c/ruby/ ...

      Plus, programs compiled with Cygwin's GCC only work within a Cygwin shell. I've yet to link to mingw successfully, though.

    2. Re:What is wrong with Cygwin? by 99BottlesOfBeerInMyF · · Score: 1

      What is wrong with Cygwin?

      Cygwin is a hack. It is an add on to Windows, not an integral part of it. On OS X I can pipe output from GIMP straight to Photoshop. Try that on Windows+Cygwin. Try doing anything interesting that involves both Windows applications and CLI applications within Cygwin.

      How can he bash Cygwin (sorry, no pun intended) without even bothering to say anything about it?

      I imagine because it is common knowledge. Cygwin is an attempt to compensate for the lack of a native shell in Windows, but it is a "good enough" work around.

    3. Re:What is wrong with Cygwin? by raphae · · Score: 1

      does "interesting" include things like scripts that can check status of running services, starting, or stopping services, or scripts to synchronize data between locations? what does "pipe[ing] output from GIMP straight to Photoshop" have to do with "anything that involves both Windows applications and CLI applications within Cygwin"? something is non-sequitur here...

    4. Re:What is wrong with Cygwin? by ClioCJS · · Score: 1

      You should look into JPSoft's 4NT. It's amazing. I've basically been using this product for about 20 years. I have cygwin, I know unix somewhat (but have alwyas primarily been a DOS/Windows man), but would much rather write scripts for 4NT than for bash. At least, on a windows machine this is true.

      --
      -Clio
      Karma: Bad (mostly from not giving a fuck)
      Blog: http://clintjcl.wordpress.com
    5. Re:What is wrong with Cygwin? by Anonymous Coward · · Score: 0

      Did you ever run a bash script in cygwin, you better don't have any pipes in it because cygwin becomes slower then a glaciar with pipes in it. I use a lot of scripts for extracting and formatting data for my users (research group at a university hospital), I use a central Linux computer for the scripts (fedora core 6) and my users interact with it by samba and ssh, I tried cygwin on the personal computers, but scripts running under a minute on the linux computer, took easily over a hour under cygwin.

    6. Re:What is wrong with Cygwin? by 99BottlesOfBeerInMyF · · Score: 1

      does "interesting" include things like scripts that can check status of running services, starting, or stopping services, or scripts to synchronize data between locations?

      I said "anything interesting that involves a Windows application and a CLI application." Do you need to use both for those? Nope, didn't think so.

      what does "pipe[ing] output from GIMP straight to Photoshop" have to do with "anything that involves both Windows applications and CLI applications within Cygwin"?

      Well, I'll explain it to you. You see, you can run GIMP from the command line within Cygwin in order to process images. Photoshop is a Windows native application. Thus piping data between them sort of has something to do with "both Windows applications and CLI applications within Cygwin." Are you trolling or are you really failing to comprehend here?

      something is non-sequitur here...

      Non Sequitur literally means "it does not follow." Thus your statement that "something is [it does not follow] here..." doesn't really make sense to me. You could argue that my logic is a non-sequitur (used as the informal noun to describe the logical fallacy), but I pretty much just presented facts, so you'll have a hard time making it apply.

    7. Re:What is wrong with Cygwin? by raphae · · Score: 1

      GIMP as far as I knew was a gui app. I didn't even know there was a Cygwin port. I was mainly considering Cygwin in my original posting from the point of view of its command-line offerings. If GIMP has been ported to Cygwin I would say that that is a pretty marginal, specialized usage of Cygwin for whatever you are trying to do.

      To use that as an example invalidating the usefulness of Cygwin is in fact ridiculous. I'm sure my mountain bike could also be adapted with a feature to make toast or something but I wouldn't trash its usefulness for riding on trails because it made inferior toast.

    8. Re:What is wrong with Cygwin? by ZwJGR · · Score: 2, Informative

      I installed cygwin and hated it, installer kept screwing up, and it was really slow.
      A dedicated ReiserFS partition with a Slackware 11.0 disto and installation of coLinux on Windows solved (almost) all my problems. Bypass M$ entirely, the freedom of bash...
      (The only snag is that cofs isn't finished yet)

      As for powershell, I installed it when it was in beta and still called Monad, year or so ago, I was impressed, but it seemed like a lot of COM bloat to me... (FYI, I hate COM/OLE from a programmers perspective)

      --
      There is no psychiatrist in the world like a puppy licking your face - Ben Williams
    9. Re:What is wrong with Cygwin? by 99BottlesOfBeerInMyF · · Score: 1

      GIMP as far as I knew was a gui app.

      First, the cygwin project also supports an X11 implementation for the GUI interface to apps. Second, almost all Linux environment programs have a CLI component. Standard in and out is a universal concept to the OS, allowing you to use the command line to integrate different applications with one another.

      If GIMP has been ported to Cygwin I would say that that is a pretty marginal, specialized usage of Cygwin for whatever you are trying to do.

      Who cares if the example is GIMP. It could just as easily be LaTeX or XMLtoPDF or pretty much anything else. The point is, you can pipe data back and forth between apps running within Cygwin, but not to any native Windows applications, which seriously restricts the usefulness. Sure you can easily apply a regexp to the command line version of SVN running within Cygwin to get a lot of functionality. Now try getting that regexp to work from the bash shell with the Windows native TortioseCVS. Good luck.

      To use that as an example invalidating the usefulness of Cygwin is in fact ridiculous.

      No it isn't. An example is just that, one program where it is a problem. If you want to call that example ridiculously abnormal you have to show how that example differs from every other usage of that type in a way that invalidates the example. You've failed to do this. The fact that GIMP has a GUI is immaterial. I used it as an example because it is a real world example of where I use bash on OS X, but cannot use Cygwin on Windows for the same task.

      I'm sure my mountain bike could also be adapted with a feature to make toast or something but I wouldn't trash its usefulness for riding on trails because it made inferior toast.

      You asked how Cygwin was inferior. I gave you an example of real world use cases. I doubt anyone in the real world has to make toast with a mountain bike. Maybe you're feeling defensive because you simply don't understand the usage I'm describing, but that is no reason to make up absurd comparisons. Lets just leave it at, "cygwin fails because it runs Linux apps that don't integrate well with Windows apps" and the assumption that you don't understand in what way it fails to integrate.

    10. Re:What is wrong with Cygwin? by dave420 · · Score: 1

      Easy. It's fucking SLOW. It does let you do all kinds of great things, but it's slow. And if you're running any services or apps that rely on cygwin, they all have to use the same version otherwise things start to act very mysteriously, and cause all kinds of weird-ass problems. I love cygwin. I got to run PHP with process control functions under windows. But then that stopped my OpenSSH service from working :)

    11. Re:What is wrong with Cygwin? by raphae · · Score: 1

      So let's review some of the useful utilities and features of cygwin in the midst of our baseless trashing of it, shall we?

      Among other things, Cygwin provides (going through a more-or-less alphabetical list here):

      antiword - command-line utility to convert MS Word docs into plain text
      autossh - ability to keep persistent ssh sessions between boxes
      BASH - need one say more?
      clamav - command-line virus scanner with very high reputation
      cron - ability to run cron scripts using standard cron interface
      cygrunsrv - control of services via command-line
      file - tool to identify file types
      less - the best command-line pager
      links - excellent command-line browser
      man - unix manpages
      ncftp - very useful ftp client
      netcat - excellent tool for diagnosing connectivty and other thins
      openssh - need more be said? this is the full implementation of openssh
      perl - need more be said?
      rsync - one of the most versatile file syncing utilities in existence
      rxvt - a first-class shell that also doesn't use some funky $TERM type which could cause potential problems on some remote systems (uses standard xterm type)
      ssmtp - way to speak smtp via command-line
      vim - the vim editor
      wget - extremely useful, highly versatile tool for fetching data from http and other servers

      This is just a short list. Sorry, but it pisses me off to hear someone say "Cygwin is a hack" when they obviously lack sufficient knowledge and experience to understand or even begin to appreciate what it offers, and then proceeds to criticize it based on some whacky, oddball special case scenario using straw-dog logic.

    12. Re:What is wrong with Cygwin? by MightyMartian · · Score: 2, Informative

      Nobody is denying that Cygwin has lots of tools, and within certain applications it does just fine. But it is damn slow, a major hog and doesn't really give you the kind of integration you sometimes need. Let's not forget that a lot of those tools on your list can be found in native Win32 binaries, without the need of the cygwin libraries. I wouldn't dream of using Cygwin's awk when I can use the win32 one. Plus the fact that it does introduce some pretty peculiar incompabilities with some non-Cygwin apps that can be difficult to overcome.

      --
      The world's burning. Moped Jesus spotted on I50. Details at 11.
    13. Re:What is wrong with Cygwin? by Breakfast+Pants · · Score: 1

      Photoshop can't accept thing through pipes. The phrase "something is a non-sequitur" is common and does not mean "something is a [it does not follow]". Your madlib attempts at being an ass [it does not follow].

      --

      --

      WHO ATE MY BREAKFAST PANTS?
    14. Re:What is wrong with Cygwin? by raphae · · Score: 1

      How is running an rsync command via a shell script run by cron a "hog"? I'm sorry, but these unqualified criticisms or criticisms based on weird scenarios or uncommon features/usages are ridiculous.

      Even if Cygwin had only 2 or 3 of the utiltities I listed above it would be eminently worth it.

      To answer someone else, what native win32 term uses $TERM type xterm? Is there native BASH for win32? What about openssh, rsync, wget, and others? If they are not running under a BASH environment how are they being run?

      Also, someone earlier complained about pathnames being inconsistent with Ruby. Ruby is available through cygwin also.

      I don't mind fair criticisms, but seeing these unqualified comments about it being a "hog", or "sucking" or whatever is just pure bullshit made by incompentent people.

    15. Re:What is wrong with Cygwin? by MightyMartian · · Score: 1

      The damn thing is a compatibility layer. By its very nature it's going to eat more cycles than a win32 app. Quite frankly, I'd sooner just run some *nix variant. I had nothing but grief running daemons (openssh and FreeRadius frequently crashed), until I finally got the point, put together a Linux box and ran the things natively. I had less problems, and FreeRadius compiled with the incredible amount of effort it took to get it running in Cygwin.

      --
      The world's burning. Moped Jesus spotted on I50. Details at 11.
    16. Re:What is wrong with Cygwin? by Teckla · · Score: 1

      Plus, programs compiled with Cygwin's GCC only work within a Cygwin shell.

      Try using the -mno-cygwin option. For example:

      gcc -mno-cygwin -o foo.exe foo.c

      The resulting executable doesn't need Cygwin at all.

    17. Re:What is wrong with Cygwin? by jhol13 · · Score: 1

      What is wrong with Cygwin? Compared to what? cmd.exe of bash in *nix?

      To latter:
      Installation: default installation doesn't install even cwd.exe.
      Home directory is not \Documents\ and\ setting\me but /home/me (fixable with symlink)
      X is still not very usable.
      Terminal is "cygwin", vt52/vt100 emulation is very poor (ssh+screen to other hosts breaks).
      Handling of network disks is awfull ("ln -s /cygdrive/c /C", etc. helps a *LOT*).
      Escapes like "C:\\Program\ Files" are PITA, as is keeping $PATH up to date.
      unzip does not handle permission properly (exe/dll => should be executable, but no => winzip packed exes gets broken).
      File locking ("cannot access - is in use") is humongously brain dead (not fault of Cygwin, per se).
      Symbolic links (and hardlinks) do not work properly (again, more Windows fault).
      From Perl (and Python, ...) you need two version: native and cygwin. Which are not 100% compatible.

      Need more?
    18. Re:What is wrong with Cygwin? by 99BottlesOfBeerInMyF · · Score: 1

      Photoshop can't accept thing through pipes.

      On OS X it can, because the OS X version of it is built for OS X, which includes very basic support for stdin/stdout via /usr/bin/open. On Windows it can't because the Windows version does not integrate at all with Cygwin, as Cygwin is not part of Windows, just an add on. With Monad, you should be able to do the equivalent of piping files to photoshop.

      The phrase "something is a non-sequitur" is common

      Yup, I referenced that. It is referring to the fallacy as a noun. But you didn't refer to something as "a non-sequitur." You wrote "something is non sequitur here" which is using it as an an adjective, not a noun... a usage which makes no sense.

      Your madlib attempts at being an ass [it does not follow].

      I was just calling you on misapplying a term. "Non sequitur" is a specific term with a specific meaning, not a random way to call something "bad" in an unspecified way while trying to make it look like you have a big vocabulary. You still haven't explained what you thought was a non sequitur in my logical progressions.

    19. Re:What is wrong with Cygwin? by 99BottlesOfBeerInMyF · · Score: 1

      So let's review some of the useful utilities and features of cygwin in the midst of our baseless trashing of it, shall we?

      What the hell are you talking about? Listen, cygwin is one of the first things I install on every Windows box. It is currently, absolutely essential for me. It is a great tool. That doesn't mean it does not have inherent limitations or that it is not a hack.

      Sorry, but it pisses me off to hear someone say "Cygwin is a hack" when they obviously lack sufficient knowledge and experience to understand or even begin to appreciate what it offers, and then proceeds to criticize it based on some whacky, oddball special case scenario using straw-dog logic.

      Let me guess, you don't know what the term "hack" means in the computer science context? A hack is a clever way to make software do something that it was not designed for. Hacking, is making software behave in ways the original design did not account for. The original design of Windows did not allow for a functional command shell or for a Linux compatibility environment. Cygwin is a hack to port a shell and useful CLI tools from Linux to compensate for that. It is not a way to properly introduce a native shell in Windows that integrates properly with applications on Windows. Monad, is an attempt by MS to alter the design of Windows to include a native shell that does integrate with Windows applications. Monad is not a hack.

      Time will tell which is more useful and used, but recognizing that Cygwin is a hack is not a criticism, rather it is recognizing the type of design it is. Hacks are harder to make work really well, which speaks to all the effort the Cygwin team has done. They don't really have the option of making changes to Windows to facilitate a proper and formal design. Because it is a hack, it will almost certainly have some limitations, which Monad need not. I've already explained to you, in another part of this thread, what a major one of those limitations is and given examples of how the functionality is lacking in comparison to Monad's theoretical functionality.

      You really need to stop being so defensive and trying to imply that everyone else simply must be ignorant, as a way to hide your own ignorance. No one knows everything and it is clear you simply don't know enough about this particular subject to understand what people are talking about. Rather than try to hide that fact and insult people, why not take it as an opportunity to learn?

    20. Re:What is wrong with Cygwin? by Ornedan · · Score: 1

      On OS X it can, because the OS X version of it is built for OS X, which includes very basic support for stdin/stdout via /usr/bin/open. On Windows it can't because the Windows version does not integrate at all with Cygwin, as Cygwin is not part of Windows, just an add on. With Monad, you should be able to do the equivalent of piping files to photoshop.
      How does Photoshop acquire the ability to pipe files on Windows when you start using Monad, without being changed to do so?
    21. Re:What is wrong with Cygwin? by 99BottlesOfBeerInMyF · · Score: 1

      How does Photoshop acquire the ability to pipe files on Windows when you start using Monad, without being changed to do so?

      The same way photoshop on OS X does with bash, by using the standard APIs. Now I'm not sure that photoshop on Vista with Monad will do this today, but I bet a whole lot of software will. Note, as far as I know Monad does not have pipes, per se, more like it has the ability to pass objects which can be files. I have not had a chance to experiment very much with Monad yet and it does not yet ship with Windows. Once it does and it has stabilized, we'll see if it is actually usable for this purpose.

    22. Re:What is wrong with Cygwin? by Breakfast+Pants · · Score: 1

      Give me *one* example of some code that 'pipes' something into photoshop. Surely it isn't 'cat /tmp/img.png | photoshop', and I would love to see what the hell you are talking about.

      --

      --

      WHO ATE MY BREAKFAST PANTS?
    23. Re:What is wrong with Cygwin? by raphae · · Score: 1

      I admit that I was defensive because I felt that Cygwin was being dismissed in a way that was unfair to it. I understand about the nature of its not being a native shell and thank you for elucidating a bit more about its distinction with Monad.

      I do not know how useful having a more integrated shell really would be for me however, and I would not doubt that Microsoft would do everything in their power to limit the functionality and interoperation of Cygwin with their applications and OS framework to the greatest extent possible.

      In the end, I wasn't trying to even defend the usefulness of Cygwin per se as much as I was that of many of the excellent GNU utilities that it makes available. Ultimately I think trying to use a Microsoft platform for anything serious becomes inane.

    24. Re:What is wrong with Cygwin? by 99BottlesOfBeerInMyF · · Score: 1

      Give me *one* example of some code that 'pipes' something into photoshop. Surely it isn't 'cat /tmp/img.png | photoshop', and I would love to see what the hell you are talking about.

      I think what you're missing is "usr/bin/open." It has a man page.

    25. Re:What is wrong with Cygwin? by Breakfast+Pants · · Score: 1

      Since photoshop can take filenames as arguments on the command line, that seems pretty useless. Still, I'm waiting for *one* example of how you are potentially going to use that with photoshop, which you still haven't provided.

      --

      --

      WHO ATE MY BREAKFAST PANTS?
  16. Re:9 years? by Anonymous Coward · · Score: 1, Funny

    Witness the glacial development of Perl6. Feel free to fork, speedy.
  17. Re:it's obvious THAT YOU ARE A LINUX TROLL by Anonymous Coward · · Score: 0

    "Stop trying to fix windows and switch to linux. Windows is hopeless. If you can't run linux then you might as well end-it-all now, because you life is not worth living." - by jcgam69 (994690) on Wednesday May 02, @03:15PM (#18961063)

    SILENCE, PENGUIN TROLL!

    After all, You were the one foolish enough to choose the underdog, now, live with it.

    (Yes, you live in "linux land" and I will stay in Windows, the most used Operating System on the planet, & all the way from the home level, to departmental servers using client-server mode, to the HIGH end, in Enterprise Class 24x7 stable operation (or, isn't NASDAQ going high-transaction, 24x7, evidence of this?)).

    That all said, gee, one wonders: If Windows is used more on all of those levels, and it is? Where is the greatest chance of earning monies then? Answer - Windows.

    15 years now, and Linux still has not toppled Windows as the most ubiquitous and flexible environs there is, with the most peripheral device support (not meaning cpu platforms it ports to, but devices one can attach to a computer), and most surrouding software for various purposes.

    Heck, Linux hasn't even "taken out" the other UNIX variants!

    And, before you say "Windows has bugs/viruses/trojans/malware" etc. et al, remember, so do the others & it is just that they are not as targetted because there is less attack surface out there since they are less used & most of them are the result NOT of the Operating System Windows itself nowadays, but moreso in applications that ride on it (such as IE, when it is NOT secured by turning off JavaScript/ActiveX control usage/ActiveScripting).

    (Besides, look @ the 'bright-side' of bugs: Techies love those same bugs/virus/trojans/malware, because it keeps them in a job - think about it!)

  18. What is wrong with Cygwin? - Performance ... by Anonymous Coward · · Score: 0

    Performance of cygwin is abysmal. Actually not cygwin per se but the whole XP in which cygwin works ...
    Same machine, same task:

    XP+cygwin over 3 minutes
    FC3 less than 3 seconds

    Task involved greping and seding an processing hundreds of files ... The cost of processes
    and files in XP killed it ...

    1. Re:What is wrong with Cygwin? - Performance ... by MightyMartian · · Score: 1

      I did quite a bit of work with Cygwin a few years ago, even managing to get FreeRadius up and running. It's good from the limited perspective of needing a *nix tool and having an environment to do it in, but Cygwin is really kludgy, to the point that I finally gave up on it. I just don't think it's stable or efficient enough to be trusted with production tasks. It's great for "gee-wiz, I'm running KDE in my Windoze box", but I sure the hell wouldn't want to do anything serious with it.

      --
      The world's burning. Moped Jesus spotted on I50. Details at 11.
    2. Re:What is wrong with Cygwin? - Performance ... by Deagol · · Score: 1

      Have you tried the suite of utils that David Korn wrote for Windows? Just curious. I tried it several years ago, and was impressed. I haven't done a side-by-side between Cygwin and Korn's tools, though.

    3. Re:What is wrong with Cygwin? - Performance ... by Anonymous Coward · · Score: 0

      UWIN is great, much higher performance than Cygwin, and higher level of standards compliance. Open source and well supported.

      http://www.research.att.com/sw/tools/uwin/

    4. Re:What is wrong with Cygwin? - Performance ... by Tacvek · · Score: 1

      Have you tried the suite of utils that David Korn wrote for Windows? Just curious. I tried it several years ago, and was impressed. I haven't done a side-by-side between Cygwin and Korn's tools, though. Be careful there, There is a David Korn who works with Cygwin. No relation to the more famous one, but still ...
      --
      Stylish sheet to fix many problems in Slashdot's D3: https://gist.github.com/801524
  19. Some clever spacing by Hoplite3 · · Score: 4, Funny

    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.

    --
    Use the Firehose to mod down Second Life stories!
  20. I'd love Powershell, if it weren't for one thing: by 3m_w018 · · Score: 5, Interesting

    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?

  21. What about MKS? by markdj · · Score: 3, Informative

    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?

    1. Re:What about MKS? by Anonymous Coward · · Score: 0

      Why in hell would I pay $479 for a single developer license, or $2000 for a 5-user development license, when the free alternatives provide identical if not superior functionality?

    2. Re:What about MKS? by PinkPanther · · Score: 1

      You forgot MKS toolkit

      ...and from which this book's author, Bruce Payette, (and a number of the Softway folks) are former employees...

      --
      It's a simple matter of complex programming.
    3. Re:What about MKS? by countSudoku() · · Score: 1

      I did not know that! Cool! I liked MKS *very* much, but still prefer cygwin with it's nice X-windows hooks. MKS is available free on the Veritas NetBackup v3.4 Vault(?) install CD, if you've got one lying about the shop. FYI.

      --
      This is the NSA, we're gonna geet U h@x0r5! Also, what is a h@x0r5?
    4. Re:What about MKS? by PinkPanther · · Score: 1
      The MKS Toolkit had its day. For quite some time it was The Bomb. But other tools now exist that match and exceed the Toolkit (though maybe MKS's support is stronger...it was back when I was there).

      MKS continued to milk the Toolkit revenue to pay for development of its SCM products (MKS Source Integrity, Web Integrity, Code Integrity, Track Integrity, Name That Product Integrity,...). I've not seen much Integrity in the wild these days, but it does show up at the odd customer site from time to time (yes, "odd" as in "infrequent" AND "odd" as in "non-standard" ;-)).

      --
      It's a simple matter of complex programming.
  22. A solution to a problem that doesn't exist by Anonymous Coward · · Score: 0

    ''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.''

    Those only get you how far exactly? With a Unix shell (Cygwin/MSYS) you can do all the unixy things you want. Perl is a complete general purpose programming language. If you don't like Perl's abominable syntax, there exist Windows-centered programming languages that can be used in place of scripts too, like Visual Basic, VBScript and JavaScript. Note that two of these are already supplied with Windows and the other is a Microsoft product too.

    So as it stands, I simply don't see what use Powershell has. There are plenty of good tools available already, some of them free and open source to boot.

  23. Cost of transition by Anonymous Coward · · Score: 0

    I'm guessing a lot of people are going to be nodding (or modding) in agreement, while typing away on a QWERTY keyboard, misspelling words in English (that language where spelling makes no sense), measuring things with the Imperial system, ...

  24. The name PowerShell has been already taken... by harry666t · · Score: 1, Interesting

    harry@satan:~$ apt-cache search powershell
    powershell - powerful terminal emulator for GNOME

    1. Re:The name PowerShell has been already taken... by Mia'cova · · Score: 1

      The official name is "Microsoft PowerShell" and is not to be referred to as "PowerShell" alone. You shouldn't see anyone from MS calling it otherwise. You're welcome to shorthand the name and cause confusion though :)

    2. Re:The name PowerShell has been already taken... by PinkPanther · · Score: 1

      The same goes for "MS-Windows" instead of "Windows" and "MS-Word" instead of "Word".

      --
      It's a simple matter of complex programming.
  25. You could fit 500 PDP-11/70s in that shell! by argent · · Score: 1

    It is a hog at best, and at worst when you are using it semi-heavily it can easily chew up 1GB of memory.

    1GB for a command interpreter?

    Christ.

    I mean, just...

    No, I can't come up with words that are strong enough.

    Holy mother of Moore, they've got good crack in Redmond.

  26. Re:9 years? by Anonymous Coward · · Score: 0

    I guess we should throw out Chomsky's contributions should be thrown out, too. Fool.

  27. Why is JPSoft's 4DOS/4NT not mentioned? by ClioCJS · · Score: 1
    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.

    --
    -Clio
    Karma: Bad (mostly from not giving a fuck)
    Blog: http://clintjcl.wordpress.com
  28. The philosophy behind textual data by mangu · · Score: 3, Interesting
    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.

    1. Re:The philosophy behind textual data by Chris_Jefferson · · Score: 1

      Of course, this amazing textual thing would be fine, if only it wasn't for the fact that unix decided to allow spaces in file names, which means I find many of my scripts designed to loop over a group of files end up producing bizarre error messages whenever there is a file with a space. This is fixed by Powershell.

      --
      Combination - fun iPhone puzzling
    2. Re:The philosophy behind textual data by jandrese · · Score: 1

      This can also be fixed in Unix by writing your scripts better. It is a major problem though because people don't realize it's a problem until it's too late (their script is bombing), and the fixes are not always obvious.

      --

      I read the internet for the articles.
    3. Re:The philosophy behind textual data by 0xABADC0DA · · Score: 2, Insightful

      On the other hand, a monad version of /bin/sort could just call the toString on all the objects and sort them based on that. Or it could sort on any other method you gave it, for instance:

      Sort by name:
          du -x / | sort --method 'toString'

      Sort by size:
          du -x / | sort --method 'getSize'

      Also you could do things like make your own output formats without having to use /bin/cut and guess at what the right columns are going to be. If the commands are set up to take closures you could send them little 'scriptlets' that hook in to what the basic command does.

      Look I'm sure Microsoft screwed it up so it's stupid since they basically screw up everything they do. But the actual idea behind it doesn't have to be as bad as your rant. Especially since you can always convert any object to a string and then are you back to unix.

    4. Re:The philosophy behind textual data by Anonymous Coward · · Score: 0

      Just tossing one off here but in PowerShell, you could do this:

      ls -rec | sort -prop length -desc | select length,fullname | ft -groupby length -wrap > mem.txt

    5. Re:The philosophy behind textual data by Dillon2112 · · Score: 1

      This is along the same lines as the question that's been cropping up in my mind as I read this thread:

      Unix shell implementations are not what's holding us back from doing the whole "passing an object" thing between programs, right? I mean, wouldn't all the command line utilities have to support passing objects as well? Wouldn't this mean a rewrite of most of the GNU collection of programs, for example?

      This very much flies in the face of what Unix stands for. We configure everything using text - text is the universal language in Unix. Once we established that, we mastered the art of creating tools that can do everything imaginable in text - Emacs and Vi are a testament to the importance of text editors. One huge advantage of text is that it is both machine readable and human readable - when something goes wrong, I can always hit up the .*rc or .conf file and figure out what's up - often without know much about the file format.

      If we move to objects, isn't their translation to text (.toString() in Java, __repr__ in python, (display) in Scheme) going to be lossy? It certainly is in every other OO system I've used. The advantage of text is that it's WYSIWYG - literally...there is nothing more and nothing less to it than what you see on the screen.

      So, assuming we get to the place where the conversion isn't lossy (we can view the contents of objects and understand their behavior with certainty for debugging), and ALL programs support the use of objects, and objects can be viewed/edited as well as we edit text today with tools that are as mature as Emacs and Vi are today. What then? What have we bought ourselves that iPython doesn't offer right now? I'm really quite curious because I just don't know if the all that work is worth what we get back in return.

      OTOH, I completely understand the desire for command line access to GUI programs in Linux. I have often wished I could script GUI actions in Linux on the command line, and was kind of surprised this need wasn't more mainstream.

    6. Re:The philosophy behind textual data by Peaker · · Score: 2

      For every sort operation one would have to write a comparison function to decide which object should come before the other.

      There is already a comparison function written for each type of object (especially ints and strings, the only objects sort can really compare).

      Piping objects is a super-set of the power of piping textual strings, as a sibling poster mentioned: You can always convert objects to strings, but not vice versa.

      A powershell equivalent (with my own invented syntax):
      du -x / | sort

      Ofcourse since "du" outputs numbers, sort will already compare them properly, whereas with text-strings, you have "weak typing" and need to re-specify how to correctly interpret the data (sort -n) .

      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.

      Objects can represent themselves in any meaningful way you want. As text, too. So you don't need a debugger either.

      Debugging and generally programming the shell would become easier as you will be communicating your intent, rather than using ad-hoc string encoding/recoding techniques to get the data through the tools.

      An object powershell is more powerful than a shell, kind of like Python is more powerful than bash, except that unlike Python, its syntax is designed to be easy for one-liners.
    7. Re:The philosophy behind textual data by MS-06FZ · · Score: 5, Insightful

      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

      --
      ---GEC
      I'm but the humble pupil, seeking to snatch the scratchbuilt pebble from the master's fully articulated hand
    8. Re:The philosophy behind textual data by Anonymous Coward · · Score: 0
      ls -rec


      I don't know about PowerShell, but in Unix ls is not the same as du. The du command lists the total amount of disk used by each directory, while ls lists each file.

    9. Re:The philosophy behind textual data by yerM)M · · Score: 1
      Just a quick python comment: if __repr__ is lossy, then you haven't implemented it correctly.


      The point of __repr__ is to output the string representation that can be evaluated by Python to produce the __repr__'s object. For instance

      foo = Foo(1)
      repr(foo) ==> "Foo(1)"

      This causes a lot on confusion sometimes when people view the repr of floating point numbers since the __repr__ shows the floating point error, i.e. 0.4 cannot be exactly represented in a C double.

      >>print repr(0.4)
      0.40000000000000002

    10. Re:The philosophy behind textual data by Anonymous Coward · · Score: 0

      And what if du didn't put the size as the first field? What if du output that value in a formatted manner, e.g. "1.56M" and "356K"? What if sort didn't have an -nr option? You are at the mercy of the specific tools you use to implement the specific text features in order to carry out your tasks. If a particular command line app doesn't fit exactly into the expected model then you have to break out awk and sed and write nasty and error-prone script to attempt to transform the text stream into something you can use. And if the command line utility doesn't output a value in which you're interested, you're fucked.

      And to accomplish that statement in PowerShell:

      $drives = [System.IO.DriveInfo]::GetDrives() | where { $_.DriveType -eq "Fixed" }; $drives | add-member -type scriptProperty -name SpaceUsed { $this.TotalSize - $this.TotalFreeSpace }; $drives | sort -property SpaceUsed -descending | ft Name, SpaceUsed

      This is a good example because the collection of objects doesn't have a usage property so I had to add my own and calculate it, but I can do that without having to parse through text and write in a different scripting language to try to piece it back together. And because it's objects I can further process this any way I want beyond what I'm just displaying on the screen, and I can save it to a fully type-safe variable to continue to process further in script, or serialize it out to XML and do side-by-side comparisons. Show me that in a purely text shell.

    11. Re:The philosophy behind textual data by Anonymous Coward · · Score: 0

      The information can also be accessed perhaps a bit easier via WMI:

      Get-WmiObject Win32_LogicalDisk | select DeviceID, Size, FreeSpace, @{n='Used (MB)';e={$_.Size/1MB - $_.FreeSpace/1MB}}

    12. Re:The philosophy behind textual data by mangu · · Score: 1, Insightful
      If a particular command line app doesn't fit exactly into the expected model then you have to break out awk and sed and write nasty and error-prone script to attempt to transform the text stream into something you can use.


      As opposed to writing a nasty and error-prone script to attempt to transform the object into something you can use in Powershell, I suppose? One of the big advantages of text interfaces is that you can test it on the keyboard and screen. I can quickly and easily create test cases in my text editor, to create a test case for a binary object you must write another script, and risk making a mistake.


      An example of a common error is date formats. When I write a date in my text editor I know how I do it, "May 2, 2007", or "2/5/2007", or "2007/05/02", etc. When you have a binary object you have no way of knowing for sure the exact internal format you have used for the data. What if the person who sent you a binary file used two digits for the year and forgot to tell you? Binary data is much more error-prone than text.


      And because it's objects I can further process this any way I want beyond what I'm just displaying on the screen, and I can save it to a fully type-safe variable to continue to process further in script, or serialize it out to XML and do side-by-side comparisons.


      Just as you can further process text data in any way you want. You can save it to disk, you can compare it side by side, you can even *gasp* convert it to XML if you want. Anything you can do with binary data you can do with text, but the opposite is not necessarily true. You cannot edit a binary object with a common text editor like the one you use to edit your scripts.


      I repeat what I said in my former post, Microsoft has no idea of what they are doing. The type of work you mention is an *application*, not a shell command. Bash is for controlling the computer itself in a simple but powerful way. It's not meant for the applications that run in the computer. The difference is the 1GB of memory that Powershell uses compared to 1MB useb by bash. The one-liner I mentioned is for situations like "disk full? I thought we had plenty of space, let's see ... Oh, no, Johnny has been downloading whole DVDs in his home directory again!".


      When you want to create applications or more complex scripts there are plenty of options available. There's Python that's much easier to learn than Powershell, there's Perl that has plenty of ready-made scripts available, there's Ruby that already does all that "object oriented" stuff if you are into that, there's C for creating highly optimized code, there's Java when you need to coordinate a big team of programmers. Powershell is doomed to failure because it wants to become each of those languages, without being as good as any of them in their respective specialties.

    13. Re:The philosophy behind textual data by sethawoolley · · Score: 1

      The above reply mentioned a " character, but I thought it might not be obvious that spaces in a variable 'file' are expanded as a single argument when passed to a program as "$file" (with double quotes) through almost any unix shell. No escaping needed. Anybody who's spent two minutes in unix shells here are wondering why you think spaces are difficult for shell scripts.

    14. Re:The philosophy behind textual data by omicronish · · Score: 1

      As opposed to writing a nasty and error-prone script to attempt to transform the object into something you can use in Powershell, I suppose? One of the big advantages of text interfaces is that you can test it on the keyboard and screen. I can quickly and easily create test cases in my text editor, to create a test case for a binary object you must write another script, and risk making a mistake.

      You don't know what you're talking about. I can test PowerShell stuff at the keyboard and screen. All commands have detailed documentation accessible from the command-line. You also never deal with binary data when working with objects.

      An example of a common error is date formats. When I write a date in my text editor I know how I do it, "May 2, 2007", or "2/5/2007", or "2007/05/02", etc. When you have a binary object you have no way of knowing for sure the exact internal format you have used for the data. What if the person who sent you a binary file used two digits for the year and forgot to tell you? Binary data is much more error-prone than text.

      The standard .NET DateTime object is used throughout PowerShell. While you've listed 3 different date-time representations (and there are many more throughout the world), PowerShell has exactly one standard representation in the DateTime object. I think your world would be more error-prone.

    15. Re:The philosophy behind textual data by Furry+Ice · · Score: 1

      I was actually very surprised to learn that zsh doesn't need the " character. I know it took me a while to learn to quote variable expansions, and now I do it religiously, but zsh works the way I would have expected when I was first learning.

      The downside to the zsh approach is that it's difficult to get a single variable to expand into multiple arguments, for example the options to pass to a JVM. It's common to do something like:

      JAVA_OPTS="-server -Xms16M -Xmx128M -verbose:gc -verbose:gc"
      java $JAVA_OPTS -jar orion.jar

      With zsh, you have to use eval to split the variable back into individual options:

      java $(eval print -- $JAVA_OPTS) -jar orion.jar

      I haven't used zsh enough yet to determine which style I really like better.

    16. Re:The philosophy behind textual data by nacturation · · Score: 1

      An example of a common error is date formats. When I write a date in my text editor I know how I do it, "May 2, 2007", or "2/5/2007", or "2007/05/02", etc. When you have a binary object you have no way of knowing for sure the exact internal format you have used for the data. What if the person who sent you a binary file used two digits for the year and forgot to tell you? Binary data is much more error-prone than text. Why did you invent this concept of a binary file just so that you could point out the flaws? Of course binary files have this problem, whether you work in Unix or in Windows. However, that's completely orthogonal to the discussion. Passing .NET classes whose methods you can call to operate on the data is of course completely different from passing in random binary files. From the sounds of it, you think all methods in a code library should follow this form:

      char *someMethod(char *argument);

      After all, if text is the only way to be sure why would you pass anything else?
      --
      Want to improve your Karma? Instead of "Post Anonymously", try the "Post Humously" option.
    17. Re:The philosophy behind textual data by Chris_Jefferson · · Score: 1

      Fix this, which I can easily do with powershell. PS don't merge the find and grep, this is just a small example which shows how pipes destroy file names.

      find . | grep bath | xargs rm

      --
      Combination - fun iPhone puzzling
    18. Re:The philosophy behind textual data by alphamugwump · · Score: 1

      "Data is structured (or information about the structure of the data is communicated) using mechanisms that are respected by all tools involved."

      But it's a plain fact that not all data is structured. The powershell commands may output and input XML, or whatever it is they do. But not everyone uses XML. Oh, sure, maybe everyone SHOULD use XML. But they don't. It's like Java. If you mandate a monolithic platform, compatability problems go away by definition. Your new problem is to convert everyone to your language of choice. How enticing -- replace computer problems with theological problems.

      I think PowerShell is an interesting idea, don't get me wrong. But this is a horrible, horrible assumption to make. The problems you mentioned: ftp, environment variables, and so on are a consequence of not having a powerful enough filesystem. Plan 9 can mount FTP shares, I think. Reiser 4 treats files as objects, but it does it at the kernel level, and it doesn't involve XML. Doing that stuff in the shell is just dumb, because it locks you into that shell, and offers no backwards compatibility. Or, more likely, you have to import stuff in, and then export it back out.

      The whole point of a traditional shell, IMHO, is to be an interface to the kernel. Sure, you have loops, conditionals, and variables, but they're really just window dressing. A traditional shell is supposed to just be a thin veneer over the surface. If you really want seamless ftp, it really should go in the kernel (as a daemon), so that everything can get at it, instead of just your shell. Likewise, if you want better inter-process communication, the thing to do would be to build out DBUS.

      That's not to say that a higher level shell wouldn't be a good thing. But it should be much more like a programming language than a traditional shell. Abandon all pretense of pipes, executables, and so on; you're really making library calls. If you want higher-level semantic pipe, screw XML. Go with stream operators. Frankly, the whole concept of 'programs that you run to get stuff done' is sort of a hack anyway; really, everything should either be a kernel, a daemon or a library. Executables are used as commands, in bash. But it shouldn't be that way at all. The semantics of your user interface should be contained by the user interface daemon, the "shell".

      Of course, there is an advantage to having executables as commands. It makes it really easy (trivial, in fact) for the shell to modify itself (change its keywords). Most programming languages, on the other hand, completely suck at modifying themselves. Hence, if you really want the ultimate shell, you would probably want to go a full step higher, and look at something like lisp or perl 6. Of course, it would be optimized for dealing with files and that sort of thing. Of course, that brings up the question of why we still deal with files and such at all.

      This is the core of computer science. You try to decouple the interface from the implementation. Ultimately, this is impossible, because the interface gets its semantics from the implementation. Ultimately, as interfaces become higher-level, you start thinking of user daemons as kernel daemons, the 'kernel' gets bigger, and everything gets shoved down a level. That's what should happen. You should not go down into the lower layers and rework it to make it object-oriented, or use XML, or whatever. This was a discussion the linux devs had -- should the proc filesystem use XML? Of course it shouldn't. First, as was pointed out, it's complete overkill. Second, XML exists at a much higher level of abstraction. It's quite a high-level means of representing data. That's the whole fucking point of 'abstraction'; not mixing high-level ideas and low-level ideas. Oh, sure, you can try. You can have your self-hosting compilers, kernels that bootstrap themselves, and so on. But such things generally mark a big important turning point, because thinking on multiple levels of abstraction is hard, especially when they bend around and bite their tail. Once

    19. Re:The philosophy behind textual data by Anonymous Coward · · Score: 0

      I don't think you quite understand what ultimately makes the PowerShell flawed, I think this guy explained it best.

    20. Re:The philosophy behind textual data by MS-06FZ · · Score: 1

      "Data is structured (or information about the structure of the data is communicated) using mechanisms that are respected by all tools involved."

      But it's a plain fact that not all data is structured. The powershell commands may output and input XML, or whatever it is they do. But not everyone uses XML. Oh, sure, maybe everyone SHOULD use XML. But they don't. It's like Java. If you mandate a monolithic platform, compatability problems go away by definition. Your new problem is to convert everyone to your language of choice. How enticing -- replace computer problems with theological problems.

      I've spent a lot of time thinking about object-oriented command shells - this is a wrinkle I've already considered.

      It's clear that people aren't going to drop what they're doing and all use one grand unified binary format for all their input and output. For many programs it wouldn't make sense - and there's bound to be some application that would push the limits of that particular format to (or beyond) its limits. For instance, streaming files over the internet demands certain characteristics of files that can't be met by things that aren't designed to be read or written in a strictly serial manner. But all data follows some kind of structure, or else it's meaningless. It's a fundamental and unavoidable requirement of data storage on computers.

      If you go back to Electronic Arts' original 1985 "IFF" format spec, you'll find a description of their quaint (but noble) ambition - to create a file format that would be respected system-wide. It was to be the one format, and all the things we take for granted today were to be implemented using it - and every new file format would fit into the scheme. That was the idea. I understand it even had a nice little run on Amiga systems. But, yeah, it's a fine example of how mandating one binary format won't work. I don't even want to contemplate stuffing every program's output into the XML format... And today, every nontrivial application defines its own data formats, and they don't follow any particular conventions about how file formats should be identified. Would I propose redefining established formats like JPEG, PNG, MP3, MIDI, XCF, HTML, BLEND, and so on to fit some new scheme? Oh, hell no.

      What I propose, instead, is that when a program outputs data in a particular format, it also provides some means of communicating how to interpret that data. The functional equivalent of a Python binding for the data, more or less - if it's a structure, you know what fields it provides, if it's a sequence, you can get elements out of it, if it's text, you know what encoding it's in, if it's a number, you know how to interpret it. So a process may output audio data in MP3, but at the shell level, that data would be an MP3 object. If the receiving process has specialized code for interpreting an MP3 object, it can do things like access the raw data stream (MP3 data), or use the object interface to do things at a higher level - but if it's a naive application that just knows how to deal with the shell-level concept of audio data, or audio data in some compatible format, then there'll be a conversion in there. So the shell mandates a format, but has no delusions of mandating the format.

      For backwards compatibility, information like this could be provided statically - if I have a program that I know is going to put out MP3 data, that can be added as an attribute of the program in a kind of masking layer.

      Yes, I certainly do want an OO shell to become so widely adopted that people won't mind coming to rely on it and integrate it into everything. My hopes can't be realized otherwise. But I know that between here and there, such a tool would first have to be useful in the current landscape before adoption could occur.

      As for your other arguments -
      - There's not a lot of advantages to having FTP clients as part of the kernel. I think I get what you're saying here,

      --
      ---GEC
      I'm but the humble pupil, seeking to snatch the scratchbuilt pebble from the master's fully articulated hand
    21. Re:The philosophy behind textual data by nbagnall · · Score: 1

      Powershell doesn't have a du command as standard - however I knocked together this script:


      function global:Measure-Directory
      {
          param (
              [string]$Path = (write-error `
                  "Usage: Measure-Directory [-Path] path [-Recurse]"),
              [switch]$Recurse = $false
          )
          process {
              gci $Path -Rec:$Recurse |
              ? { $_.psiscontainer } |
              % { $dir=$_; gci $_.fullname |
                  ? { -not $_.psiscontainer } |
                  measure -sum -average -minimum -maximum length |
                  % {
                      add-member -name Length -value $_.Sum -membertype NoteProperty -pass -inp $dir |
                      add-member -name Count -value $_.Count -membertype NoteProperty -pass |
                      add-member -name Average -value $_.Average -membertype NoteProperty -pass |
                      add-member -name Minimum -value $_.Minimum -membertype NoteProperty -pass |
                      add-member -name Maximum -value $_.Maximum -membertype NoteProperty -pass
                  }
              }
          }
      }

      set-alias du Measure-Directory

      that would allow me to issue:

      du -r / |sort length -desc > mem.txt

      But it would also allow me to issue:

      du / -rec |? {$_.count -gt 10}|? {$_.LastWriteTime -gt "2007-01"} |sort length |ft Length,Count,Minimum,Maximum,Average,LastWriteTime ,fullname -auto -wrap

      to find all directories with more than 10 files which have had files added since the beginning of the year, sort them by directory size in ascending order and report the directory size, number of files, smallest, largest and average file size along with the last modification time and the full directory path in a sensibly formatted table.

      Because PSH passes along the directory object (onto which Measure-Directory has grafted a set of metrics) the pipeline can refine the search using any of the directory properties (timestamps, attributes, etc) and output as many or as few as desired.

      PSH has its problems, not least is the fact that all those familiar utilities are no longer the best solutions when working in an object shell, yet in most cases replacements have not been written by MS or the community. It should be remembered that the only complete toolchain developed for PSH so far targeted MS Exchange.

      It also has its (lets be kind) idiosyncrasies - compare the slow performance of gci *.exe versus the cmd.exe like performance of gci . *.exe - that make you wonder whether it is overly developed for manipulating system configurations at the expense of care and feeding of a directory hierarchy.

      Despite some reservations though, I'd have to say it is an immensely logical shell and while I wouldn't go without the gnu toolchain at the moment, I am curious as to see how PSH compares when it (eventually) gets its own complete toolchain.

    22. Re:The philosophy behind textual data by I'm+Don+Giovanni · · Score: 1

      Yours was a good post until you felt the need to pander to the "I hate Microsoft" crowd with "Look I'm sure Microsoft screwed it up so it's stupid since they basically screw up everything they do." If you think it's good, just say it.

      Seems like everytime someone says something good about Microsoft around here, they chicken-out and throw in the "But I'm sure it sucks anyway" qualifier. Microsoft's programmers were educated at the same colleges as other programmers, and are NOT inherently worse than anyone else. If the concept is good, there's no reason to believe that Microsoft would "screw it up" any more than anyone else would. Throwing in the lame "I know that Microsoft sucks, but ..." or "I hate Microsoft as much as the next guy, but ..." qualifiers is lame.

      --
      -- "I never gave these stories much credence." - HAL 9000
    23. Re:The philosophy behind textual data by 0xABADC0DA · · Score: 1
      You can put a world-renowned chef in a sewer and have him cook an omelet, but people are still going to vomit all over it. If microsoft programmers feel like they are being disparaged unfairly they need to get out of the sewer or clean it up.

      If you think it's good, just say it. And that's exactly why I wrote that way, because if somebody interpreted my post as you did as supporting monad that would be very wrong. I do believe the idea of passing objects through pipes has some merit though.
  29. perl -e by Anonymous Coward · · Score: 2, Insightful

    You're obviously just parroting Unix ideology and haven't even bothered to take a glance at Monad to see how it compares. As I understand it, Monad's object model is essentially a superset of Unix's file model. I haven't used it enough to speak to how it works in practice, but it is a fundamentally more powerful paradigm.

    If we want/need to call an OO scripting language, we can do just that thank you very much. Typical Microsoft non-solution to a non-problem just so they can lock users to their ailing platform.

    1. Re:perl -e by Shaman · · Score: 0, Offtopic

      MARK PARENT UP PLZ.

      --
      ...Steve
    2. Re:perl -e by seaturnip · · Score: 1

      Perl can only elegantly invoke other perl components. Monad can interface with any CLR object. Shell scripts are all about taking completely disparate pieces and mashing them together with duct tape to perform a task. Bash and monad are good at this; perl is not.

  30. A quick intro to Monad by sootman · · Score: 3, Interesting

    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 videos. 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? :-)

    --
    Dear Slashdot: next time you want to mess with the site, add a rich-text editor for comments.
    1. Re:A quick intro to Monad by countSudoku() · · Score: 1

      Yes, the standard shells are all command oriented, textual and several lack good networking hooks like perl does, but then we also have ruby...

      Oh look, Ruby 1.8.6, and for Windoze too!

      http://rubyforge.org/frs/download.php/18566/ruby18 6-25.exe

      Joy of joys!

      --
      This is the NSA, we're gonna geet U h@x0r5! Also, what is a h@x0r5?
    2. Re:A quick intro to Monad by SCHecklerX · · Score: 1

      Why do you need 'network hooks' when you can use netcat? Or on linux, just use /dev/tcp/hostname/port. The shell, as with every other task, is just glue.

      If you want a little more flexibility (ie, you are writing something that doesn't work well as just gluing a bunch of OS commands together), you then use the proper tool: c, perl, whatever.

    3. Re:A quick intro to Monad by abanathabla · · Score: 0

      01:52:12 | 7 $ echo "command | filter | filter" | wc -c
      26


      01:52:45 | 9 $ echo "OK, run this command, now of the things it output, go back and tell me this and this about them." | wc -c
      97


      01:53:26 | 10 $ echo "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." | wc -c
      151


      01:55:05 | 3 $ echo "ps -eo command,%cpu,%mem --sort %cpu | tail -n 5" | wc -c
      49


      Guess what? I'll stick with bash. Making a shell able to tell you all this information with it's built-ins is also braindead.

    4. Re:A quick intro to Monad by nuzak · · Score: 1

      Even more impressive are these videos that show PowerShell Analyzer, an add-on for powershell.

      Hit up http://www.powershellanalyzer.com/demos/index.html for the videos (more choices than direct links would give you, and static screenshots too)

      I can't see those movies, so perhaps they're the same thing?

      --
      Done with slashdot, done with nerds, getting a life.
    5. Re:A quick intro to Monad by CrankyOldBastard · · Score: 1

      As I said somewhere else, look at Squeak's OSProcess plugin. It turns a Smalltalk Workspace into a object oriented shell.

    6. Re:A quick intro to Monad by DragonWriter · · Score: 1

      The whole point of Monad is that it's not just text, it's objects.


      Yes, and there are Java shells that do this, too, though, IIRC, none quite as polished as Monad yet. Inherently, this kind of thing is a neat application of having an object-oriented platform. No doubt, as well as java-based ones (which already exist, though I don't think any are as polished as PowerShell yet), Unix will have .NET based OO shells running on Mono, and maybe some running on some of other OO platforms out there.

      But I'm not sure how much PowerShell gets you that using an OO language with a good set of file- and system-utility libraries (like, maybe, Ruby) as a "shell" (via an interactive console session) doesn't. After all, it seems you have to use tools built into it or designed to work with it to get any advantage over a typical shell, and if you are willing to live with that kind of limitation, well, Ruby or other OO scripting languages seem to provide provide much the same thing.

  31. Re:I'd love Powershell, if it weren't for one thin by Shados · · Score: 2, Informative

    Its the typical .NET deal. First time you run something it takes a bit, after that its instant.

    So basically, what makes it suck less, is to use it more.

  32. You can knock it but it IS VERY USEFUL by Evilged · · Score: 3, Interesting

    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

  33. Passing objects, huh? by aix+tom · · Score: 1

    Does that mean the 40 gig file I can pipe to a Unix command is passes as an object in PowerShell, and maybe loaded into memory first? ;-)

    Other than that it might prove really useful. I have often looked for some way to simplify the piping in unix without having to play with sed/grep/awk to much and hope the command output doesn't change in future versions.

    Microsoft has of course the advantage that they can define the object format in-house.

    Maybe one should have a look at such a format for oss software (<cheesy_buwwzord> maybe an xml schema</cheesy_buzzword>), and creating additional objout/objin pipes in addition to the stdin/stdout ones.

    1. Re:Passing objects, huh? by Anonymous Coward · · Score: 0

      Ummmmmmmm, you mean like a scripting language? Like python? maybe ruby? im sure there are others... Really, if your deal with "objects", then what you essentially have is a programing language, and there is no reason to replace what already exists. Is tcl object orientated? That might be what you want.

      The normal piping in *nix is more then enough, and superior to objects. If you actually need more power, then a shell script is not what you need, a programing language is what you need, and there are several interpreted ones to choose from. The point of shell scripts is to help manipulate commands, which manipulate the file system, which is text based (you dont have file names that are objects, do you?), there simply is no need for a more powerful abstraction past raw data in pipes in *nix (yes, text IS raw data .. a nice, and standard form, but still, raw data, at least as far as anything is concerned).

    2. Re:Passing objects, huh? by aix+tom · · Score: 1

      Yeah, but what is lacking somewhat is a standard way of passing data from that scripting languages from and too applications.

      I have for instance written a little perl script which automates my video encoding / dvd burning.

      For getting the information for the source file I use "mplayer -identify" and get a list of information in a PARAMETER=VALUE format, which I must parse. Then I have to construct the command line parameters for all the scripts in another format. Then I have to write the configuration file for dvdauthor in XML. Then I have to write the configuration file for some of the subtitle processors in yet another format.

      Which might not be a problem for me and you, but it would be nicer to have a somewhat standard format to pass data in the pipes.

      ps -eaf |grep process |grep -v grep|awk '//{print $2}' |xargs kill

      Works fine, until someday on some platform someone manages to create a user with a space in the name.

      It's an interesting idea to separate the data a program uses form the text in/out. Objects might not be the best way, and the implementation from MS might suck, but it's basically a worthy idea in my opinion.

    3. Re:Passing objects, huh? by Anonymous Coward · · Score: 0

      All very true, but my point was that the UNIX command line is supposed to be text based, and text is all very simple. Objects are a more complex system, and in that regard is inferior unless adequate protections are in place. Since *nix is text/data based, attempting to use objects IS futile, your essentially reinventing everything that was text based.

      By using objects you introduce a new system that is WAY more complex, possibly to complex to be within a OS (especially a *nix OS where simplicity is held to high standards). All the complexity doesn't really bring much to the table in terms of what the *nix shell is supposed to do: tie together programs (not applications, applications basically ignore the basic OS anyways, doing things their ways, so in the end it doesn't really matter).

      Introducing a similar system in other OS's isent something i say is overly hard, you already have languages that can be used to what you want, the main problem would be a shell to tie that language together, and a new idea of a program which exists within the shell (possibly in the language), but outside of the OS, so that the program/application can only be run from inside that shell (much like a function inside of bash is only within bash, you cant run it from the OS). With that, using objects or other of the languages data types should be fairly easy, and what you end up with is essentially a cheap knock off of what MS has, and probably (from what i read in other discussions today) a lot less resource intensive. If done right, you might even be able to call the programs from the language naturally, overall benefiting the language.

    4. Re:Passing objects, huh? by misleb · · Score: 1

      Ugh, no more XML! If I were going implement object passing between commandline programs, I'd use a dynamic scripting language such as Ruby and marshal (dump/load) objects to text and pass them that way. So any program that wanted to support it could link to libruby and use ruby to transform stdin/stdout. The program could automatically detect if it was recieving Ruby objects or just plain text like usual. And a commandline switch would tell it to output ruby objects to stdout. Of course the real problem then becomes getting enough programs to support it!

      For example, a version of the 'cut' command that could output an array of strings would be useful. Or xargs that, instead of just dumbly just taking each line and an argument, coudl be passed Arrays or Hashes with more complex parameters for executing programs. Or a find command that could take a hash of paramters from another program (rather than building complex commandline arguments) and would output more detailed information for each found filesystem object in as Ruby arrays.
      Then again, maybe using Ruby is more complex than necessary. I mean, if the vast majority of data types are just Arrays and Hashes, you could just define a more generic serialization that programs could implement themselves. Though it would still be interesting to pass more complex objects even though I can't think of any use cases off hand.

      -matthew

      -matthew

      --
      "THERE IS NO JUSTICE, THERE IS ONLY ME." -Death
  34. FYI - PowerShell is not just for Vista by Brit_in_the_USA · · Score: 2, Interesting

    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

    1. Re:FYI - PowerShell is not just for Vista by jeffbopp · · Score: 0

      But it's not available for Vista Home or even Home premium. Balls to that and M$.

  35. No autoconf by Anonymous Coward · · Score: 0

    Someone wake me up when they put out a shell that will run autoconf successfully. The day I can just run "./configure; nmake; nmake install" will be a happy day indeed.

  36. Re:I'd love Powershell, if it weren't for one thin by Bloody+Templar · · Score: 3, Interesting

    That's not an apples-to-apples comparison, though.
     
    In cmd.exe, "dir" is "dir." It gives you a text listing of the files and subdirectories of your current directory. In PowerShell, "dir" is an alias for "get-childitem," which returns an object array that can either be parsed for display in the console, or passed down the pipeline to another commandlet.

  37. Copy and Paste by tobiasly · · Score: 1

    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.

    1. Re:Copy and Paste by Anonymous Coward · · Score: 0

      What you're complaining about is the console system in Windows, not cmd, powershell, or any specific console-mode application. The console window you see is owned and managed by csrss.exe, and console-mode apps talk to it via a very restricted API.

    2. Re:Copy and Paste by mhotchin · · Score: 1

      This is a problem with the *console window*, not with the program running inside it. If you run 'Bash' in a console window, same problem!

      It's not a good reason to not use PowerShell. Look for 'clip.exe', it provide a simple mechanism for moving text to/from the clipboard from the command line.

    3. Re:Copy and Paste by redelm · · Score: 1
      A reasonable complaint; and one fairly reasonably fixed by adding an option to `gpm` or `selection` ---strip_eol . Not always adviseable, but often convenient.

    4. Re:Copy and Paste by Mia'cova · · Score: 1

      Pipe the string you want directly to the clipboard? In theory you'll have an object and should be able to send just a URL or whatnot to the clipboard. I understand your frustration but console output is fixed-width and has line breaks. It's just the way things are done.

  38. Prompt by PenGun · · Score: 1

    Can the prompt be the present time ... like my bash prompt?

    1. Re:Prompt by Evilged · · Score: 2, Interesting

      Yes you can, you set it in your Powershell profile, look for the function prompt.
      [datetime]::now.ToLongTimeString() give current time btw.
      G

    2. Re:Prompt by PenGun · · Score: 1

      How 'bout a nice green for it's colour?

        Can I do this? I call it dupedvd:

      #!/bin/sh
      rm stream.dvd
      mkfifo -m 666 stream.dvd &&
      sleep 1
      dd if=/dev/dvd1 of=stream.dvd &
      sleep 1
      growisofs -dvd-compat -Z /dev/dvd=stream.dvd &&

        You need a couple of burners or a burner and a reader. The sleeps keep it from tripping over it's self.
          Eh'

    3. Re:Prompt by Evilged · · Score: 1

      It can do lots of things, if you want you could read about it and find out, but I doubt you do.
      I thought you were asking a honest question, rather than trying to start a my 'whatever' is better rant.
      Sorry
      G

    4. Re:Prompt by PenGun · · Score: 1

      Wrong again. I was interested if there was any equivalent to dd actually. Without that and useful pipes what good is a scripting language? I do have a lot of scripts, it's pretty well how I do everything.

        Windose has been useless for me except to flash my burners periodically. Mostly because the interface is so brain dead. I don't do click click click ... it's for morons.

    5. Re:Prompt by Evilged · · Score: 1

      If you just want the dd command it is in the the GNU port of Unix utils UnxUtils, and in Microsoft Unix toolkit.
      Also to be wrong again I would have to be wrong twice, in your view I can only see how I can have been wrong once, in my assumption of your intentions.
      If you want to flash you burners in Linux from the CLI buy a NEC (Optiarc now) drive you can flash in Linux, OS X etc.
      I am sure you could find other supported drives if you tried.
      If your read about Powershell you will find it does do 'useful pipes', but surprise, surprise its been developed by Microsoft to administer Windows not Linux, so will be of little use to you.
      Bash and other shells are designed for and best on Linux, they are great and powerful and we use them on all are Linux servers.
      Shells such as this could be ported but without the OS integration they would be next to useless, I have to use Windows to manage 1000+ AD users and computers, I can do that with powershell, not with Cygwin shells etc. I even use it to manage Linux servers via piping from powershell via SSH!
      You can hate Microsoft and GUI's all you like but powershell is one of the few good things microsoft has brought to its OS, and the more administrator that use, the easier it will be for them to use and move to Linux, so it has its good points!.
      G

  39. one nad? by Anonymous Coward · · Score: 0

    MS should get a pair.

    1. Re:one nad? by bwcbwc · · Score: 1

      Dunno. It could also be "Moan Ad" or "Mo' nad".

      --
      We are the 198 proof..
  40. ps can be misleading by Cassini2 · · Score: 1

    It looks like you are using ps. ps on Linux can give misleading memory usage reports. Specifically, it counts the entire shared library against every process that loads it. For a program that loads shared libraries, like bash, this results in a significant memory allocation that isn't "real". If one copy of bash was the only program on the system, then bash would use 1 GB. However, 3 copies of bash, don't use 3 GB. They use much less. Additionally, if the same shared libraries used in bash are used in any other programs running on your system, and on Linux they probably are, then the total memory allocation falls further.

    This website explains the problem better: http://virtualthreads.blogspot.com/2006/02/underst anding-memory-usage-on-linux.html

    This is a well documented bug. I don't actually use a Mac, but likely the Mac O/S running bash exhibits the same behaviors as Linux.

    1. Re:ps can be misleading by cp.tar · · Score: 1

      It looks like you are using ps.

      Damn... please, please don't start your posts like that... I just had a horrible vision of Clippy jumping out on my Gentoo box saying "It looks like you are using ps."

      Had a moment of near heart failure... like vigor all over again.

      If one copy of bash was the only program on the system, then bash would use 1 GB.

      It's either :s/bash/Monad or :s/GB/KB.

      However, 3 copies of bash, don't use 3 GB. They use much less.

      So very true.

      --
      Ignore this signature. By order.
  41. Re:9 years? by Anonymous Coward · · Score: 0

    It's worth noting that Chomsky's classifications of formal language types doesn't constitute a programming language. Which was the point of the original poster's remark, whatever you think about it.

  42. Re:Windows "power shell"? by MS-06FZ · · Score: 4, Interesting

    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.
    --
    ---GEC
    I'm but the humble pupil, seeking to snatch the scratchbuilt pebble from the master's fully articulated hand
  43. Re:Windows "power shell"? by dhasenan · · Score: 1

    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.

    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.

    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.

  44. WSH since 1997? by timjdot · · Score: 1


    Windows Scripting Host (WSH) was released in like what? 1997? How is PowerShell any different than what you could do with WSH?

    --
    Expect Freedom.
    1. Re:WSH since 1997? by Jugalator · · Score: 1

      WSH mostly just interacting with COM objects etc.

      It had no unified concept of using an object oriented methodology for in/outputs and chaining commands.
      And most of all, it was a scripting host, not a shell.

      --
      Beware: In C++, your friends can see your privates!
  45. Bean Shell by hachete · · Score: 3, Interesting

    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.

    --
    Patriotism is a virtue of the vicious
  46. Quick OS X Question. by orlanz · · Score: 1

    I had a project that required me to start and stop a Flash application from a very slightly modified UNIX daemon process in Mac OSX. I was unable to figure this out going through the command line.

    I can do "open flash_application.swf" in a command shell from the daemon process, but the "open" command detaches completely from the shell and doesn't provide any type of handle to the launched application. What I would love would be to use the original UNIX code that simply does a "kill $flash_pid" but unfortunately, "open" doesn't shoot back the pid.

    You seemed to know a bit about Max OSX, so I ask here. Google gives me a LOT of false positives that go something like... "how to do... without ... command line" the exact opposite of what I need.

    Thanks in advance.

    PS: For those who don't know: open is equivalent to double click on the file, the OS automatically finds the assigned application and runs it feeding the file. And fyi, the application can't be run from the command line and fed the file manually, the shell doesn't see it as a command line executable nor does it attach the application to the user GUI screen if required.

    1. Re:Quick OS X Question. by Anonymous Coward · · Score: 0

      What's the program that should be running the SWF?
      Try talking to it with Applescript, which can be run from the command line with the osascript command.
      You should be able to kill the program by doing something like this:

      osascript -e 'tell application "WhateverApp" to quit'

    2. Re:Quick OS X Question. by orlanz · · Score: 1

      I don't have the Mac in front of me, but it is the Flash Standalone Player. I will try what you said, thx.

  47. Re:I'd love Powershell, if it weren't for one thin by Grishnakh · · Score: 2, Insightful

    It's that slow with a directory with only hundreds of files? I have directories with tens of thousands of files; I wonder how slow it would be with those.

  48. The early steam age of computing by Qbertino · · Score: 1

    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.

    --
    We suffer more in our imagination than in reality. - Seneca
    1. Re:The early steam age of computing by daverabbitz · · Score: 1

      In my experience VT102/linux/xterm terminal support is pretty much universally supported by things which use ssh. Did you try running xterm (I assume you have X11 installed)?

      SSH actually (is supposed to) transmits the contents of the TERM environment before you get a shell. The only way I can see this not working is if their is no termcap/terminfo entry for your terminal, in which case it would be intuitive for me to set the TERM variable to either xterm, linux or vt102 and try my luck. If that didn't work then Mac terminal must be pretty silly (assuming it doesn't have a VT102 mode).

      --
      What could be better than a jet powered motorcycle? http://www.youtube.com/watch?v=u8l6GTHLSWE
    2. Re:The early steam age of computing by Qbertino · · Score: 1

      Your reply in it's entirety pretty much emphasises my point above.

      --
      We suffer more in our imagination than in reality. - Seneca
  49. Re:it's obvious THAT YOU ARE A LINUX TROLL by Anonymous Coward · · Score: 0

    I agree. I particularly like Windows DRM. I feel safer knowing my OS is phoning home to MS every 15 days or so.

  50. Or, Greenspun's 10th Rule: by mkcmkc · · Score: 4, Funny

    Any sufficiently recent Microsoft OS contains an ad hoc, informally-specified, bug-ridden, slow implementation of half of Unix.

    --
    "Not an actor, but he plays one on TV."
    1. Re:Or, Greenspun's 10th Rule: by mrogers · · Score: 0, Redundant

      Whereas any sufficiently recent non-Microsoft OS contains an ad hoc, informally-specified, bug-ridden, slow implementation of 95% of Unix. ;-)

  51. Wonder if they trademarked it? by Anonymous Coward · · Score: 0

    Because, otherwise, I forsee a Cease & Desist letter in their future, even if they had the name first.

  52. An object-oriented shell for Linux by MS-06FZ · · Score: 1

    Want to help me write it? I have ideas and enthusiasm at this point - not much else. Talk to me if you're seriously interested in making it happen.

    --
    ---GEC
    I'm but the humble pupil, seeking to snatch the scratchbuilt pebble from the master's fully articulated hand
  53. Re:Windows "power shell"? by SL+Baur · · Score: 1

    it seems like when it comes to the CLI people are content to let it rot. It hasn't "rotted", but it has been sufficiently powerful for several decades now that there aren't many features that need to be added. My favorite hack of the 80's was writing a BASIC interpreter in Korn Shell script with floating point math, gosub/return, single step, pause/continue, full line curses line editing and what not. It was still a Unix style program. It had a small helper program that did the parsing and evaluation of arithmetic expressions and used ed(1) as an coprocess for program storage. It only took a couple of days to code up too.

    The Z-shell has had dynamic loading of extensions for about 10 years now. I suppose someone could have added GUI extensions that way. Maybe they have, I haven't checked on their development in a long time. Basic textual zsh works perfectly for me.

    Glad to see though that Microsoft Windows is finally catching up to old technology in this area.
  54. if it really was a hardship, put Windows in a VM by Locutus · · Score: 1

    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

    --
    "Anyone who stands out in the middle of a road looks like roadkill to me." --Linus
  55. Re:I'd love Powershell, if it weren't for one thin by Anonymous Coward · · Score: 1, Interesting

    Probably painfully slow. I don't know enough scripting to actually benchmark it ... but on C:\windows\system32 (> 2k files) "dir" via CMD was done in well less than two seconds. After two seconds, PowerShell was barely up to the letter C.

    But, as another poster mentioned, with the performance hit comes the ability to treat each item returned by dir as a .NET object. You just can't do that with CMD.

    Still, if all you need to do is list a directory's contents then you don't need PowerShell. With PS I can -- from the command-line -- manage remote computers via WMI (and let me tell you, the occasional ability to troubleshoot remotely without firing up VNC is stellar), with some custom scripts I can manage Active Directory (having to simply type 'add-employee "Joe Sixpack"' is ... well, stellar). It's a very powerful tool at only a 1.0 implementation, so it'll only get better... /Posting anonymously not because I'm an MS shill, but because I don't want to sacrifice my mod points on the article.

  56. Re:Windows "power shell"? by MS-06FZ · · Score: 4, Interesting

    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. :)
    --
    ---GEC
    I'm but the humble pupil, seeking to snatch the scratchbuilt pebble from the master's fully articulated hand
  57. Wow! by PhotoGuy · · Score: 0, Troll

    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!!!

    --
    Love many, trust a few, do harm to none.
    1. Re:Wow! by Mia'cova · · Score: 1

      MS PowerShell is a separate download for XP, Vista, and Win2K3. It's not included out of the box in any of them. The point of this shell is that it's object oriented. The classic windows shell and most of the others out there (eg bash) aren't. I'd suggest you pay even a tiny bit of attention to what you're reading but you clearly don't seem to care.

  58. Groovy by SuperKendall · · Score: 1

    We all have one, it's called Groovy - a Java-based scripting language that steal functional tricks from elsewhere.

    And I can use it on any platform.

    --
    "There is more worth loving than we have strength to love." - Brian Jay Stanley
  59. Re:Windows "power shell"? by mackyrae · · Score: 1

    Exactly. Everything you could ever need to do on Linux, you can do from the shell if you know the commands. Windows? Most programs don't take command line arguments or run in command line mode. That's part of why cmd.exe is so useless. There are no apps that make use of it. There's also the lack of things like grep, sed, etc. in the cmd.exe that make it useless. Bash has all of that, and it has had it for ages. The PowerShell is just MS trying to make an actual useful shell like we have because the old one was so bad.

    --
    look! it's a bird, it's a plane, it's....a girl? yes, a girl browsing Slashdot on Linux
  60. Quoting by SuperKendall · · Score: 1

    Of course, this amazing textual thing would be fine, if only it wasn't for the fact that unix decided to allow spaces in file names, which means I find many of my scripts designed to loop over a group of files end up producing bizarre error messages whenever there is a file with a space. This is fixed by Powershell.

    Just as it is fixed in a shell by anyone who can use the " character. I have written many shell scripts that are fine when encountering filenames and directory names with spaces, which I use all the time.

    --
    "There is more worth loving than we have strength to love." - Brian Jay Stanley
    1. Re:Quoting by Chris_Jefferson · · Score: 1

      OK, fix this (note, you aren't allowed to merge two commands, I want to get across the point of many commands..) find . | grep bath | xargs rm

      --
      Combination - fun iPhone puzzling
    2. Re:Quoting by jotaeleemeese · · Score: 1

      In Solaris:

      find . | egrep 'bath.*' | xargs rm

      for file names starting with bath

      or

      find . | egrep '.*bath.*' | xargs rm

      for any files with bath in their name

      but of course you could use

      find . -type f -name '.*bath.*' -ls -exec rm {} \;

      which is the right tool for the job.

      As other posters have insisted, a bit of quoting goes a long way to use the shell properly.

      --
      IANAL but write like a drunk one.
  61. Re:Windows "power shell"? by MS-06FZ · · Score: 1

    it seems like when it comes to the CLI people are content to let it rot. It hasn't "rotted", but it has been sufficiently powerful for several decades now that there aren't many features that need to be added. My favorite hack of the 80's was writing a BASIC interpreter in Korn Shell script with floating point math, gosub/return, single step, pause/continue, full line curses line editing and what not. It was still a Unix style program. It had a small helper program that did the parsing and evaluation of arithmetic expressions and used ed(1) as an coprocess for program storage. It only took a couple of days to code up too. Hacks are fun and all - I thought it was neat when someone implemented Tetris using the "Zork" runtime engine - but I'm less interested in the theoretical capabilities of a shell than in the actual, useful set of features that the shell provides to help me solve problems better.

    Let me give an example: one that I contend could be made easier to handle by using a "modernized" and object-oriented command shell.
    Suppose I want to iterate through audio files on the filesystem - get "title" metadata from those that have it, and the length of the audio in time units, format that into a list structure and save it in an environment variable. Now, with bash, I'd either need one command capable of doing this task with each of the various audio datatypes on my hard disk, or else I'd need to switch between the various file types and run the appropriate command.
    Now, object-oriented shells won't magically solve all our problems - for instance, if an object for some reason decides to call its "title" field something else - or if a format doesn't have those fields (C64 SID files might have a runtime field - but that was added as an extension, so maybe not) - but the OO solution would be to ask each file for this information.

    > $data = for f in (find /audio); do append_output (($f -title), ($f -time)); done

    Presumably that would return some nil objects in one or both columns depending on what files are processed. But that's the general idea. And then I'd also like to be able to do this:

    > ./data_list = $data

    Seems like a nice idea to me.

    The Z-shell has had dynamic loading of extensions for about 10 years now. I suppose someone could have added GUI extensions that way. Maybe they have, I haven't checked on their development in a long time. Basic textual zsh works perfectly for me. Interesting. Perhaps you could enlighten me a bit as to what these zsh extensions can do? As I said I have this project that's been mulling around in my head for a few years now, for a Linux shell with similar capabilities to Powershell - and in order to justify that work and to direct in sensibly I want to have a better understanding of other shells and operating environments, what they have to offer and what went wrong. I believe in the ideas I'm advocating here, but I also know I can't take them for granted - if I fail to adequately understand Unix then I, too, am likely to reinvent it badly.

    I would say I am skeptical of what a zsh extension can accomplish. Sure, a shell extension can add new functions to a shell, but how does that help with the problem of improving command pipelines? How does that help me not to forget to account for the possibility that "find" could return filenames with whitespace in them, or that a field in a character-delimited file could contain the delimiter? Or if it doesn't do that, what does it do?

    Glad to see though that Microsoft Windows is finally catching up to old technology in this area. Whether they've "caught up" or "caught us snoozing and lapped us" is a matter of preference, I suppose. I think it also depends on how nice the shell is to actually use. I find the high degree of verbosity in the command naming rather annoying, actually - I suppose that probably helps with L10N but I am used to CLIs being rather more compact. But in terms of functionality they've provided something that I have a strong desire to see realized on Linux.
    --
    ---GEC
    I'm but the humble pupil, seeking to snatch the scratchbuilt pebble from the master's fully articulated hand
  62. UNIX more consise by SuperKendall · · Score: 1

    Sort by name:
            du -x / | sort --method 'toString'

    Sort by size:
            du -x / | sort --method 'getSize'


    Why is what you propose any better than simply defining new flags on du? If you have to add a new method to du, you can just as easily add a new flag. Then you don't have to have wordy --method arguments everywhere, you use flags like "-x" on DU or other applications.

    --
    "There is more worth loving than we have strength to love." - Brian Jay Stanley
    1. Re:UNIX more consise by omicronish · · Score: 1

      Why is what you propose any better than simply defining new flags on du? If you have to add a new method to du, you can just as easily add a new flag. Then you don't have to have wordy --method arguments everywhere, you use flags like "-x" on DU or other applications.

      The PowerShell sort commandlet works on all objects, all object attributes, and all commands that generates those objects. Your proposal involves bloating every command for which you want to perform specialized sorting with special switches.

      For example, the Get-Process commandlet returns .NET Process objects, which have over 20 attributes over which you can sort. I wouldn't want 20+ switches for sorting. Also, -member is optional, so you can do: get-process | sort PeakWorkingSet

  63. Re:Windows "power shell"? by seaturnip · · Score: 1

    CLR objects can have string conversion methods if you want to output them as text; you can convert between text and binary and back in a way that's in fact more elegant than the Unix manner (where frequently parsing code ends up rewritten multiple times). I really don't see what we lose by moving to the Monad model.

  64. GNU/Linux is more than the shell. by twitter · · Score: 1

    I think we have crusty old 1970s shells with a veneer of tab-completion and command history added for convenience.

    ... and paths that work, and sane date and time tools, and tools that can be gotten with package managers that work and up and down the whole GNU toolchain into userland. The "Power" in bash is much more than tab complete, the power is freedom in action. Nothing M$ will ever touch that. All of their effort just goes to show that no single company can compete with free software.

    I think it's kind of a drag that Microsoft may now have a better CLI than Linux ...

    You will feel better if you think about it a little longer. Really. I'm not sure what you mean by "wrangle live .NET objects and complex datatypes" but I do know that programs can be written and called that do exactly the same thing, with pipes even, without bastardizing bash. Talk about "new techniques" and "dot NET" gives me bad flashbacks to ten years ago when someone tried to give me VB religion. I'm glad I avoided that and this new "Power shell" looks like a second rate bash with a second rate tool set.

    --

    Friends don't help friends install M$ junk.

    1. Re:GNU/Linux is more than the shell. by jZnat · · Score: 2, Funny

      Oh man, are you bashing PowerShell there? ;p

      --
      'Yes, firefox is indeed greater than women. Can women block pops up for you? No. Can Firefox show you naked women? Yes.'
    2. Re:GNU/Linux is more than the shell. by dedazo · · Score: 1

      I'm not sure what you mean by "wrangle live .NET objects and complex datatypes"

      Which is your problem, though not also the reason you'd dismiss something like this. Microsoft has actually come up with a way to manage system entities as full-fledged objects in a character-based environment using a simple command set, which is something they started doing six years ago with WMI. You are still stuck with the text-in-a-pipe invented thirty years ago, but of course something like this coming from "M$" is useless regardless. So why don't you just avoid sharing your insight with us? All you do is display your obnoxious arrogance and unfortunate ignorance.

      --
      Web2.0: I love when people Flickr my cuil and digg my boingboing until my google is reddit and I start to yahoo
    3. Re:GNU/Linux is more than the shell. by Tim+C · · Score: 1

      tools that can be gotten with package managers that work and up and down the whole GNU toolchain into userland

      Which of course is a feature of the distros, not of GNU/Linux, and if you step outside the sandbox of the distro-maintained packages then the situation is often every bit as bad as that for Windows and sometimes worse. I fail to see what that has to do with a discussion on the perceived short-comings of the commonly-available GNU/Linux shells though.

  65. Without Perception by twitter · · Score: 1

    ... monads were the windowless metaphysical atoms of perception itself.

    This is fitting. M$'s value is all a matter of perception, which is why M$ spends a billion dollars a month on marketing. Without that perception, there would be no windows.

    Still, I like the original name, MSH (warning: Fake Community Effort) better. MSH can and should be parsed as "MicroSoft Hell" and it reminds you of the DOS toupper roots of it all.

    --

    Friends don't help friends install M$ junk.

  66. PowerShell isn't a Shell It's a scripting language by Anonymous Coward · · Score: 2, Insightful

    Linux already has lots of scripting languages.

    For example you have python. Python has several shells you can work with. The default python shell or ipython shell are two examples. Perl has been around forever. Ruby. Haskell. PHP. Lisp.

    Whatever floats your boat.
    Object oriented, procceedural, functional languages. Whatever you want.

    A Unix shell like Bash or pdksh is designed as a _user_interface_. Your ment to work in it for day to day tasks. You don't need to be a programmer to work it and scripting is simple and effective.

    And why text? Because text is universal. Everybody understands text. It's human readable, it's human editable. You can have all sorts of programs that are completely different, but they all understand text. Text is easy, text is how the world is ran.

    So Microsoft actually fubbed this one pretty badly. They aimed for a shell and hit on scripting language. Microsoft Windows already has a bunch of scripting languages. PowerShell is just another one.

    Sure I can run around my file system with ipython and write my own replacements of common unix commands and all sorts of crap like that, but it will take a crapload of work to turn it into something that it's not.

    The reason in Linux you use Bash for scripting is because it's convient. You always need a user interface aviable, and everybody uses it. So it's always going to be around. So you use it for things like init scripts or little things to setup the environment to launch larger programs and lots of other utility items.

    Remember:
    Text is convient, universal, and easy to understand and use (due to human readable nature). Text parsing isn't difficult if you have the proper tools.

    The Unix shell is ment to be used on a daily basis. It's easy to use and convient. You don't need to be a programmer to script with it.. it takes a single sunday evening to get most of the basics down for a reasonably intellegent person.

    It's used for scripting were you have simple, smaller tasks. Or you have tasks were other programming languages are not aviable or may not be present... like init scripts.

    Powershell is neither easy nor convient. Nor it is easy to use for a non-programmer and it's not designed to be a user interface. It's a scripting language. One of many.

  67. Re:Windows "power shell"? by SL+Baur · · Score: 1

    Suppose I want to iterate through audio files on the filesystem - get "title" metadata from those that have it, and the length of the audio in time units, format that into a list structure and save it in an environment variable. If this is all stuff that's part of the file format, this is not a shell programming activity at all. file(1) should be taught about all the fields in /etc/magic and then you can just capture its output and do what you wish with the various fields.

    the OO solution would be to ask each file for this information. I'm neither a fan of OO nor a fan of executable data that may have come off-host, but to each his own. In the case of file types, I am a fan of teaching file(1) about the format and letting it do all the messy work. Do one thing and do it well is ancient Unix wisdom more ignored than followed now-a-days, but this kind of stuff is what that program was designed to do. I do believe it is an utter mistake to judge file types by extensions.

    Sure, a shell extension can add new functions to a shell, but how does that help with the problem of improving command pipelines? How does that help me not to forget to account for the possibility that "find" could return filenames with whitespace in them, or that a field in a character-delimited file could contain the delimiter? The white space (and worse) in find output issue is a well-known potential security issue with solutions dating back to the 80's. Consistent double-quoting, including using "$(command)" instead of `command` solves most of it. Zsh has a somewhat stricter setting that lets you get away with not doing as much quoting in your scripts. The delimiter in data issue is an unsolvable problem as you describe it. If you have control over how the data is written, then you can scan it before-hand to avoid using a bad delimiter. Otherwise, you just have to choose a obscure sequence of characters as delimiter and pray.

    You've always been able to pick a simple delimiter when typing an expression like `s/old/new/' used in sed or ed - `s;o/l/d;n/e/w;'.

    Lastly, non-linear pipeline syntax does exist and is not a new feature either. Zsh uses something like <(process1) and >(process2) for command splicing.
  68. *nix should do this too by MobyDisk · · Score: 1

    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.

  69. Digital signatures required for scripts? by Myria · · Score: 1

    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.

    --
    "Screw Sun, cross-platform will never work. Let's move on and steal the Java language." - Visual J++ Product Manager
    1. Re:Digital signatures required for scripts? by Mia'cova · · Score: 2, Interesting

      The default security blocks them. To run unsigned stuff, you have to set it to accept those scripts. Just a one line command you'll see at the top of almost any blog/tutorial posting on powershell, nothing painful.

  70. effing objects by Tsiangkun · · Score: 1

    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.

  71. Re:Windows "power shell"? by kestasjk · · Score: 1

    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. bash supports arrays too, but yes I do agree that Microsoft has raised the bar with PowerShell (and I consider myself proficient in Bourne sh and Bourne Again sh so I'm not speaking out of ignorance). I know how annoying it can be when a process doesn't output the way you want and you have to cludge a sed script together to extract the info you want.
    I don't think being able to interact with the GUI is important though, or even a good idea; I just think that objects are a much better way of passing data around than text.

    Also it's not quite as drastic as you or the OP would make it seem. bash so good for those complex one liners where you have to start messing around with sed; but if you're writing a script and not just using the CLI on UNIX you have Perl, and usually Python and Ruby too, available at your fingertips. Often whenever you need to script something and bash isn't quite up to it Perl fits in nicely.

    I would say that Microsoft has brought out some really great ideas in PowerShell, and it's exciting that this is in direct response to Linux's capabilities, but I don't think it's as bad as you've made it out.
    --
    // MD_Update(&m,buf,j);
  72. Re:Windows "power shell"? by seaturnip · · Score: 1

    It's not just catching up, it's leaping ahead. Yes, it's a big surprise to see MS do this after putting zero effort into their shell for so long, but I'm increasingly convinced that the Monad way of doing things is intrinsically superior to the Unixy way. In particular, it will finally allow smooth interaction between CLI and GUI applications, which has never been feasible with the unix text stream model. Notice how modern Unix is neatly split into a CLI world and a GUI world, and the only connection is that some (usually crappy) GUI applications are wrappers around CLI ones.

  73. Re:Windows "power shell"? by seaturnip · · Score: 1

    Also, to add, the reason Unix can't do something like Powershell is that the fragmented Unix world can't unify itself around a component standard like CLR.

  74. Re:Windows "power shell"? by Anonymous Coward · · Score: 0

    I've yet to come across anything that's more rampently homosexual than, 'Fiesty Fawn'. What could possibly be more gay then the innocent face down ass up mangina kawk fodder that is the Ubantu mascott.

    Take a look at the google image search for 'ubantu fiesty fawn':

              http://images.google.com/images?hl=en&resnum=0&q=u buntu%20feisty%20fawn&ie=UTF-8&oe=UTF-8&um=1&sa=N& tab=wi

    wow

    who ever came up with this idea didn't see it coming cause they were facing- the other way

  75. Windows is finally usable... by Bigon · · Score: 1

    you can use 'ls' in a shell!!!

    1. Re:Windows is finally usable... by Anonymous Coward · · Score: 0

      Don't get your hopes up too high, when I tried to do a "ls TC*/Ma*.txt" it didn't understand. I tried the other slash too but didn't bother any further. Switched to Cygwin/Bash again, which I have good experience with. But it's nice to see they understand some people like a shell/scripting to interact with the OS, and are doing an effort.

  76. Documentation by atomicstrawberry · · Score: 1

    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.

    1. Re:Documentation by Anonymous Coward · · Score: 0

      these comments are wrong on all counts. I know most linux zealots are pretty incompetent when checking for documentation or how things work in Windows but at least just say you were too lazy rather than it is not possible or doesn't exist.

      documentation is abundant on Microsoft scripting site including sample scripts that do what you claim was too hard to work out. (if you can't work out how to execute your old batches or set environment variables from even the basic info there then well I suggest you stay away from ALL shell based scripting as there is no hope for you.

      http://www.microsoft.com/technet/scriptcenter/hubs /msh.mspx

    2. Re:Documentation by jsnover · · Score: 1

      ... but then a great book (PowerShell in Action) came along. Our in-box documentation has gotten much better as well but you pick up Bruce's book and give us a try again. I doubt you'll be disappointed. Jeffrey Snover [MSFT] Windows Management Partner Architect Visit the Windows PowerShell Team blog at: http://blogs.msdn.com/PowerShell Visit the Windows PowerShell ScriptCenter at: http://www.microsoft.com/technet/scriptcenter/hubs /msh.mspx

  77. OT: Your sig by Anonymous Coward · · Score: 2, Funny

    Saying Java is nice because it works on all OS's is like saying that anal sex is nice because it works on all genders.

    I agree with this part:

    anal sex is nice because it works on all genders.

    Java, however, still sucks. :)

  78. Re:Windows "power shell"? by ozmanjusri · · Score: 1
    It's not just catching up, it's leaping ahead.

    Leaping all the way ahead to imitating AREXX on a late '80s Amiga...

    --
    "I've got more toys than Teruhisa Kitahara."
  79. Things go better with Coke. I mean Unix by ClosedSource · · Score: 1

    "Those who fail to learn the lessons of Unix are doomed to re-invent it. Poorly." -- Forgot who said it.

    Somebody in marketing?

  80. Re:Windows "power shell"? by seaturnip · · Score: 1

    Uh do you really not understand the difference between a typeless language and an object-oriented one, or are you just trolling?

  81. Re:They kind of have already done this...(sort of) by Anonymous Coward · · Score: 0

    They kind of have already done that. Well, at least they developed a UNIX operating system (maybe sold is a better term, but it was 16bit and back in the 80s). The Windows NT kernel is basically VMS, which is essential UNIX. Again, though there are too many qualifiers to be having this discussion (I've realized this as I've been typing). I'll shut up now...

  82. but those only get you so far by Anonymous Coward · · Score: 0

    "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.

    1. Re:but those only get you so far by MS-06FZ · · Score: 1

      "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.
      --
      ---GEC
      I'm but the humble pupil, seeking to snatch the scratchbuilt pebble from the master's fully articulated hand
  83. yes it will with a slight change by sethawoolley · · Score: 1

    Put quotes around $file and ${file%avi}mpg like "${file%avi}mpg" and yes it will.

  84. I don't dare adopt PowerShell by DragonHawk · · Score: 1

    My biggest complaint about PowerShell is that I don't dare adopt it. I've still got a few Windows 2000 PCs kicking around at work (as machine controllers, so upgrades are a real bear), and PowerShell already doesn't support Win 2000. And it looks like the next major release won't support XP. Microsoft will use this as a tool to drive upgrades, just like they do with everything else.

    This really annoys me, too, because it looks like PowerShell might do some legitimately interesting things. :-(

    Sometimes, Microsoft is their own worse enemy.

    --

    dragonhawk@iname.microsoft.com
    I do not like Microsoft. Remove them from my email address.
  85. Two decades? by Anonymous Coward · · Score: 0

    "For two decades I've hated the command prompt in DOS and Windows."

    http://www.jpsoft.com/

    I find it VERY difficult to believe that someone that claims to have 20 years of experience with DOS and Windows at the command line could not know about their products. At one point, a version of 4DOS was bundled with Norton Utilities (called NDOS, as I recall).

    "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)"

    Yeah, if you spent the past 20 years blithely ignoring native software development on the PC platform.

    Sounds to me like the submitter has been waiting 20 years for Microsoft to natively implement Bash under Windows to his satisfaction, and thinks PowerShell is it.

    Or, he's just astroturfing, which seems far more likely.

  86. Can powershell fix WGA? by LaissezFaire · · Score: 1

    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. Re:Can powershell fix WGA? by Anonymous Coward · · Score: 0

      preprime the browser url line by pasting in the following line:
      javascript:void(window.g_sDisableWGACheck='all')
      then hit return and paste in the pre"validation" url for the powershell dl.

      Powershell won't fix wga although if you knew *how* you could use it to help you defeat WGA,

  87. Ahhh, 4DOS by DragonHawk · · Score: 1

    I've been using this command-line since 1988, back when it was NDOS.COM, and was much better than COMMAND.COM.

    Actually, it was always 4DOS. Norton licensed the code from Rex Conn/JP Soft, tweaked it a bit, and called it NDOS.

    4DOS rocked. I used to be a 4DOS junkie. There are still some things it did that I miss in 'nix today. I'd love to be able to license 4NT for work today, but sadly, the price isn't worth the benefit. Besides, these days I spend half my time in 'nix anyway... :)
    --

    dragonhawk@iname.microsoft.com
    I do not like Microsoft. Remove them from my email address.
  88. ever tried backquotes in perl? by sethawoolley · · Score: 1

    Perl can invoke all shell commands too by placing backquotes (or using the qx operator) around them just like a regular shell: ``

  89. try "ls -s | lpr" by sethawoolley · · Score: 1

    ls -s | lpr

    this seems like a bad way to go about it:

    "ls | select fullname,length | sort name | format-list | out-printer"

    ls -s prints the size and the name, and it sorts by name by default, and it's formatted nicely already. You might mean one per line, in which case:

    ls -s1 | lpr

  90. Re:Windows "power shell"? by MightyMartian · · Score: 1

    What in the name of fuck are you talking about? I can take a twenty year old sh script and run it with almost no difficulty on damn near every variant of *nix out there. I get the feeling that a lot of you guys have done almost nothing in *nix shells, and are just repeating the sheer crap that comes out of Redmond. Christ, if there's one thing that has been pretty goddamn standard in the *nix world, it's the Bourne fucking shell.

    --
    The world's burning. Moped Jesus spotted on I50. Details at 11.
  91. Re:Windows "power shell"? by DragonWriter · · Score: 2, Interesting

    ow, 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.)


    Its not so much dealing with a "smart CLI"—that the interface is a command line one is irrelevant—as dealing with "returning objects to an OO platform". Programs not designed to run on on OO platform (like anything designed to run on Unix or Windows but not something like .NET or the JVM) clearly aren't going to be designed to do this since they have no such platform to return objects to. And most .NET or JVM tools aren't designed to do that, because even though Java shells and Powershell exist now, they haven't for much of the time that the platforms have existed, and aren't the usual way most programmers expect their programs to be used.

    OO shells running on OO platforms will enable new ways of chaining programs together (not just from CLIs, either).

    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.


    Well, sure, the .NET platform has a CLI that allows you to do OO things. So does the JVM. Linux doesn't, because Linux isn't an OO platform, and while OO platforms exist that run on Linux, none is as central to the OS as .NET is becoming for Windows. OTOH, a "smart CLI" doesn't seem to get you much that an OO scripting language that supports interactive sessions combined with a conventional object serialization format would seem to enable even without an OO platform (and both have similar limitations with regard to legacy programs), so I don't know if Linux needs to have something like .NET to match PowerShell.
  92. Managing hundreds of remote servers by mnmlst · · Score: 2, Interesting

    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 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.

    --
    In principio erat Verbum.
  93. Re:Windows "power shell"? by seaturnip · · Score: 1

    Why don't you look up what CLR is before mouthing off?

  94. Re:I'd love Powershell, if it weren't for one thin by 3m_w018 · · Score: 1

    Bizarrely enough, I can kick off Eclipse (disabling bytecode verification and fixing the memory to 256MB), and it takes almost a long as starting a new shell instance...

    Not apples-to-apples, but I'm still really surprised (and disappointed) that the PS doesn't start up much faster...

  95. Re:it's obvious THAT YOU ARE A LINUX TROLL by MightyMartian · · Score: 2, Informative

    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.

    --
    The world's burning. Moped Jesus spotted on I50. Details at 11.
  96. Now practice: not speak of what you did not use by Gena5m · · Score: 1

    >I haven't used it enough to speak to how it works in practice >That's what they said about the early versions of Java. Now C++ is relegated mostly to embedded, systems and games programming. Java has its uses but it is yet to replace C++ as language of large software systems due to lesser flexibility then C++. You obviously like to speak of things that you haven't used.

    1. Re:Now practice: not speak of what you did not use by Augusto · · Score: 1

      Huh ... there are a lot of very large Java based software projects, this is nothing new.

      --

      - sigs are for wimps.
    2. Re:Now practice: not speak of what you did not use by seaturnip · · Score: 1

      Java is obviously dominating C++ in most generalist uses, just peruse any job listing. And what "flexibility" are you talking about? Removed languages features like MI, manual memory allocation and objects on the stack don't really prevent you from doing any task at all.

      (Also, you obviously like to post on web forums without knowing HTML.)

    3. Re:Now practice: not speak of what you did not use by Anonymous Coward · · Score: 0

      (Also, you obviously like to post on web forums without knowing HTML.)

      He never made any assertions which depend on HTML knowledge, while you made assertions which depend on java/c/etc knowledge which you had disclaimed as not knowing in the same post.

      Sorry, you lose.
    4. Re:Now practice: not speak of what you did not use by Anonymous Coward · · Score: 0

      Oh, you're so right. Those don't prevent you from doing anything at all. Not even things that have strict real-time requirements, or writing software for a microcontroller, or doing anything that requires performance that's better that "dog slow". I guess throwing more hardware at it is the accepted solution for that type of stuff nowadays. It still seems silly to me to run all this stuff with java on 20 different computers when you could run the same thing on 5 if it were written in an awful language.

  97. A great command shell through an awful GUI by jesterzog · · Score: 1

    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.

    1. Re:A great command shell through an awful GUI by Valafar · · Score: 1

      Right click on the shortcut and select properties. All of your layout and customizations are there on tabs. Also, if you hit alt+enter it will go full screen. If you would like different configurations (for example, different starting directories) then make multiple short cuts and customize each one.

    2. Re:A great command shell through an awful GUI by jesterzog · · Score: 1

      Neat, thanks for the tip. It'd still be nice to just have draggably-resizable borders, but this is better than not having anything.

  98. Re:Windows "power shell"? by Furry+Ice · · Score: 1

    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. :)


    Using objects is a very bad idea because the object itself is application specific. I don't know why everyone is acting like this Powershell interacting with objects is so new. I am dealing with the WebLogic Scripting Tool (WLST) these days which is a Jython interface to a bunch of Java APIs. I'm interacting with objects from a scripting language, and it totally sucks because my scripts don't work from one version to the next. This problem can still occur with UNIX: if you can the format of your text, your scripts are going to break. However, the very act of having to convert data to text makes you *think* about how that should be represented. It's a barrier between the internals of your application and the external world. If you expose your internal objects directly to scripts, then any internal changes you make are going to break scripts. Believe me, those internals change a heck of a lot more often than you would like them to. If you don't allow them to, then you unnecessarily burden your code with backward-compatibility problems, which is exactly what got MS' code into such a horrible state.
  99. Come one, sell me this shit. by twitter · · Score: 1

    Microsoft has actually come up with a way to manage system entities as full-fledged objects in a character-based environment using a simple command set, ...

    As opposed to any normal script that can conditionally call normal programs that manipulate files or streams while also giving helpful output on stdout and stderr that the operator and machine can interpret? What revolution is M$ producing here again? What useful thing will this do for user or machine? Really, I'd like to know what the hype is about to cure my "unfortunate ignorance".

    --

    Friends don't help friends install M$ junk.

    1. Re:Come one, sell me this shit. by nacturation · · Score: 4, Insightful

      Imagine someone gave you some library code, but to use the code you couldn't pass in variables, objects, or whatever. Each function in the library takes one input -- a string. The return from the functions are also one output -- a string. You need to convert this to/from any meaningful format in order for you to use it. That is bash.

      Now imagine the same thing, but instead of passing in strings you could pass in/out native data types, full objects, other methods, etc. That's PowerShell.

      --
      Want to improve your Karma? Instead of "Post Anonymously", try the "Post Humously" option.
    2. Re:Come one, sell me this shit. by ChrisMaple · · Score: 1
      Nothing in bash prohibits the things you suggest; it just takes more effort. Send output of any variety to a fifo or a file, read in from the same.

      Technically, the "return" is different from the "output". The "return" is usually an error status. The "output" is a string of bytes only if you refer to "stdout" or "stderr".

      --
      Contribute to civilization: ari.aynrand.org/donate
    3. Re:Come one, sell me this shit. by dedazo · · Score: 2, Interesting
      No, you don't understand. It's not like that at all. The I/O streams are objects themselves, and what you move through them are also qualified objects. It's just difficult to explain. I didn't "get it" either until I had one of those epyphanies like when you realize how std::vector works or how to use multiple CSS selectors or something like that. It's really cool.

      I wouldn't want to write an application with it because of the overhead, but for scripting (especially complex, stateful scripting) it just rocks.

      --
      Web2.0: I love when people Flickr my cuil and digg my boingboing until my google is reddit and I start to yahoo
    4. Re:Come one, sell me this shit. by nacturation · · Score: 1

      Nothing in bash prohibits the things you suggest; it just takes more effort. Send output of any variety to a fifo or a file, read in from the same. With enough effort, you can make anything do anything -- I'd agree with that. Even an abacus can be employed to find cube roots.
      --
      Want to improve your Karma? Instead of "Post Anonymously", try the "Post Humously" option.
    5. Re:Come one, sell me this shit. by hawkeye · · Score: 1

      Imagine they then based on the trimmings (trappings?) of cmd shell, thus nullifying many of the benefits... Unfortunate. Think I'll wait for a later version, and use Linux in the meantime.

      --
      "...The smart and lazy ones I make my commanders." - Erwin Rommel
  100. Re:PowerShell isn't a Shell It's a scripting langu by stimpy77 · · Score: 1

    What on earth are yout talking about??

    In all my months (both years, actually) that I have used PowerShell, I used it for its user interface, not for scripting.

    And I used it in such a way that every command, piped to every command, worked in sensible ways.

    Querying a list of objects results in a list of objects. You want text? Great. PowerShell bent over backwards and stuck its head through its legs and kissed itself in the crotch to give you clean, human-readable text out of your objects. But they're still objects. So you can introspect the properties of those objects. Or you can execute methods on those objects.

    With only text, you just have a bunch of ASCII characters, that HAPPEN to line up in a pattern that can be read by a human or, with some effort, with a textual analyzer pattern.

    But with objects, you can fire off commands that make sense because they are complete representations of WHAT THEY ARE, not how they are described in sequences of ASCII characters.

  101. ruby shell by nighty5 · · Score: 1

    I'd love to see a rip off of this but with a ruby-ish type shell.... with the object orientated uniqueness....

  102. Re:PowerShell isn't a Shell It's a scripting langu by ratboy666 · · Score: 4, Insightful

    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).

    --
    Just another "Cubible(sic) Joe" 2 17 3061
  103. Re:Windows "power shell"? by pkphilip · · Score: 1

    REXX in OS/2 could interact with the GUI objects. You could also use IPC mechanisms such as semaphores, communicate over sockets etc. But yes, you are right. I remember that you could create "install" scripts in REXX which would create icons on the desktop, setup shortcuts etc using the OS/2 presentation manager objects.

    Unfortunately no such thing exists on Linux/Unix. You are right - most of the shells we have on Unix/Linux are not substantially different from what was available in the 1970s.

  104. echo blah | C:\Windows\system32\clip.exe by Anonymous Coward · · Score: 0

    tracert slashdot.org | clip

    Too bad if it's something already on your screen that won't help :(

  105. Re:Windows "power shell"? by jacksonj04 · · Score: 1

    Yes, yes they are. And they *still* get slated from half the Linux community.

    "Windows sucks, it doesn't have a good shell!"
    to
    "Windows sucks, because although they built a good shell they copied it from us!"

    --
    How many people can read hex if only you and dead people can read hex?
  106. Where are the other Unix shells? by Anonymous Coward · · Score: 0

    Why is everyone comparing this thing to bash? There are many other good Unix shells out there as well.
    For example zsh. It has

    1: Programmable command-completition with out-of-the-box support for over 300 commands.
    2: Memory overhead less than 640k.
    3: Spelling correction.
    4: Aliases.
    5: Themeable prompts.
    6: Improved variable handling.
    7: Editing of multi-line commands in a single buffer.
    8: Full customizability.

    If this PowerShell can give me all of those and run on Unix, I'll definitely give it a shot.

  107. PHP Shell? by boiert · · Score: 1

    That's why I love PHP, print_r('$whatever');

  108. Re:Windows "power shell"? by Anonymous Coward · · Score: 0

    Do you really not understand "smooth interaction between CLI and GUI applications" or are you just a cockhead?

  109. Re:PowerShell isn't a Shell It's a scripting langu by jonadab · · Score: 1

    > The reason in Linux you use Bash for scripting is because it's convient.

    The thing is, I mostly *don't* use bash for scripting, certainly not for anything over five or six lines. There are a variety of reasons for this, but the long and short of it is that it's more convenient to use Perl.

    I use bash daily, but almost exclusively as an interactive shell, i.e., to run one command at a time and see the results. That's really what shells are good for. A shell doesn't need to be a good programming language. If I want a programming language, I'll use one that was designed for that purpose.

    --
    Cut that out, or I will ship you to Norilsk in a box.
  110. Re: Windows "power shell"? by Dolda2000 · · Score: 4, Insightful

    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.

  111. Re:PowerShell isn't a Shell It's a scripting langu by Anonymous Coward · · Score: 0

    Actually, I believe imagery is more universal than text. There is interesting, recent research on this. Google for 'IKU'.

    What about cfengine. Although it is meant to administer several computers at once, is that a lot like PowerShell?

    There is also an open source PowerShell project in existence for 7+ years. See http://powershell.sourceforge.net/

  112. It's funny that IT slowly goes back to ...LISP. by master_p · · Score: 1

    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.

  113. Re:Windows "power shell"? by fuliginous · · Score: 1

    Text is universal because the small graphical constructs that we use to form words are the smallest convenient building block we have come up with. They are quick to use and evolution of them for handwriting made them efficient to group together.

    Things like having an individual symbol for every command would result in needing about 2000 symbols for the binaries on my system.

    I might be agreeing we have made text universal sort of. But the reasons are complex. And text after all is actually a specific set of graphical symbols. So each word is only equivalent to a more complex glyph we have just adopted a seemingly efficient and compact approach to constructing complex symbols from atoms. And with things like tab command line completion it becomes really swift.

  114. You ain't seen nothin' yet by smchris · · Score: 1

    "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.

  115. Re:it's obvious THAT YOU ARE A LINUX TROLL by Tim+C · · Score: 1

    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.

    One possibility would be to provide a text-based registry editor in the style of sql*plus or similar tool; you could even use a SQL-like syntax with selects, updates, inserts and deletes. Or failing that, something more like an LDAP interface, as the registry's hierarchical nature arguably mirrors that of an LDAP server more closely than an RDBMS.

    Hell, if you really wanted you could write a text-editor style tool that understands the registry and exposes an interface to it that makes it look like a flat text file. Throw in some navigational controls (via keyboard shortcuts or vi-style commands, naturally) and it might just be workable. You could even have it able to collapse and expand sections like (eg) IE does with XML files, or have it navigate between nodes like info does.

    I appreciate that you hate the registry (and I don't entirely blame you), but that doesn't mean that a cli-based management tool can't be written for it.

  116. Re:Windows "power shell"? by cain · · Score: 1

    Better is the enemy of good.

  117. PowerShell by IpalindromeI · · Score: 2, Interesting

    I've been using PowerShell for a couple months, and it's definitely better than cmd.exe. However, it's really built more like an interactive scripting environment, with shell features left as an afterthought.

    Only the most basic redirection is implemented. Basically you can use "> file", "2> file", and "2>&1". That's it. You can't create arbitrary fd's and dup them. It's like they didn't realize that the '1' representing stdout and '2' representing stderr actually mean something more general. Oh, and no input redirection. Trying to do:
    somecommand < file
    gives you this error:
    The redirection operator '<' is not supported yet.
    At line:1 char:14
    + somecommand < <<<< test.txt


    Although you can technically use "2> file" to redirect errors, it's actually a big pain. Say your program outputs to stderr for various warnings, and you want to capture those. Well because everything is an object, each error line is converted to an ErrorRecord object, which is then serialized. Unfortunately, the serialization of an ErrorRecord includes a bunch of other clutter. Here's an example of one error line:
    > perl -e 'warn qq[Something bad happened!\n]' 2> out.err
    > cat out.err
    perl.exe : Something bad happened!
    At line:1 char:5
    + perl <<<< -e 'warn qq[Something bad happened!\n]' 2> out.err

    Three lines for every error, with a bunch of clutter to make it hard to read. In order to get succinct log files, I had to write my own ErrorRecord converter to get back to the one line I want.

    Command argument parsing is broken. The parser will split arguments that look like "-x12.34". So if you try to pass a switch with a floating point number as part of it, the program actually receives two separate arguments: "-x12" and ".34". You have to quote the entire thing to get it passed as one argument.

    One major annoyance with cmd.exe that has not been completely fixed is the quoting inconsistencies. Nested quotes don't seem to work right. In most shells, single quotes prevent any interpretation of the string, which is mostly true in PowerShell. So when writing a quick Perl one-liner, I use single quotes to make sure any Perl variables aren't interpreted by the shell.
    perl -e '$k = "hello"; print $k'
    That seems to work, and prints 'hello'. However, try adding a newline:
    perl -e '$k = "hello\n"; print $k'
    Now Perl gives me a syntax error regarding the backslash, which leads me to believe the shell is interpreting the string before handing it to Perl. In this case, I can work around it because Perl has its own quoting operators:
    perl -e '$k = qq[hello\n]; print $k'
    But how would you pass a string like this to some other program where you needed the quotes? I couldn't figure it out.

    As a scripting environment, it's pretty nice. And like I said, it is better than cmd.exe. However, basic shell functionality is semi-broken in many ways, because of the focus on Being Innovative With Everything As An Object.

    PS. Don't forget that the escape character is ` (backquote), and not \ (backslash) like in every other shell/language.

    --

    --
    Promoting critical thinking since 1994.
  118. Powershell DOS by DaveDerrick · · Score: 1

    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.

  119. Looks like cmd, feels like cmd... by hawkeye · · Score: 1

    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.

    --
    "...The smart and lazy ones I make my commanders." - Erwin Rommel
  120. Re:Windows "power shell"? by MS-06FZ · · Score: 1

    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. :)

    Using objects is a very bad idea because the object itself is application specific. I don't know why everyone is acting like this Powershell interacting with objects is so new. I am dealing with the WebLogic Scripting Tool (WLST) these days which is a Jython interface to a bunch of Java APIs. I'm interacting with objects from a scripting language, and it totally sucks because my scripts don't work from one version to the next. This problem can still occur with UNIX: if you can the format of your text, your scripts are going to break. However, the very act of having to convert data to text makes you *think* about how that should be represented. It's a barrier between the internals of your application and the external world. If you expose your internal objects directly to scripts, then any internal changes you make are going to break scripts. Believe me, those internals change a heck of a lot more often than you would like them to. If you don't allow them to, then you unnecessarily burden your code with backward-compatibility problems, which is exactly what got MS' code into such a horrible state.

    The new bit is that this isn't just a new scripting language or programming language, it's designed for interactive sessions, too. It's a tool that could be used equivalently to a Unix command shell - a general-purpose CLI. By contrast, scripting languages usually have their own "program state" of variables and whatnot, while files and outside programs are considered foreign territory in the language's syntax. A general-purpose CLI on the other hand, is a language in which the filesystem and outside executables is part of the program state. Executables on the path serve rougly the same purpose in Bash as Python modules do on the Python module path (though you don't have to 'import' them, of course) - it's your set of tools for that language.

    As for changing internals: the same can happen with text-based tools, too. In fact, it has already. I can't tell you how frustrating I find it to deal with the disparities between Solaris tools and the equivalent GNU ones - I prefer the GNU tools because I'm more accustomed to them and I think the changes they provide help to deal with a wider range of problems - but the change from one version of 'find' to another, for instance, requires the use of a different set of command line switches and different text-processing logic as a result. Things change, no matter what underlying technology you use. Stabilizing one's interfaces is a problem that must be solved regardless of whether you're streaming text or passing objects. You could standardize your field-delimiter syntax and still you'd need to stabilize your field order. (Hence, /etc/passwd still has a password field even though no one uses it these days.) You could use a higher-level metaformat like XML and still you'd need to stabilize the format and tagging of the important fields, or you will hit the same compatibility that you cite - which are the result of sloppy API stabilization in object interfaces.

    And while specific object classes may be application-specific, the means to see what they provide is not. As with Python, you can tell what all the methods and attributes of an object are.

    As for the separate output step: As I said, I'd prefer a more elegant solution. But here's the thing: along each step of a command chain, you want that data to be easy to process. It's just at the last step that you want it to be easy to read. By using structured data, the intermediate steps are some level of compromise (because - guess w

    --
    ---GEC
    I'm but the humble pupil, seeking to snatch the scratchbuilt pebble from the master's fully articulated hand
  121. Re:Windows "power shell"? by MS-06FZ · · Score: 1

    Suppose I want to iterate through audio files on the filesystem - get "title" metadata from those that have it, and the length of the audio in time units, format that into a list structure and save it in an environment variable.

    If this is all stuff that's part of the file format, this is not a shell programming activity at all. file(1) should be taught about all the fields in /etc/magic and then you can just capture its output and do what you wish with the various fields.

    I disagree. file(1) has a very specific task - which is to make a best-guess about a file format based on its contents. If you start expecting it to be actually able to interpret all those file formats - you've got a very large program, now, implementing a lot of functionality that is the proper domain of more specialized tools. No, 'file' should simply be able to tell us what program or library on the system we should talk to if we want to interpret the file. That's where the problem crops up in my example - we have the tools - we can certainly pull out title tags with mp3info - and I expect there are other tools that could do it for other formats. The problem, at a basic level, is that these tools don't even have a common interface. It could be sufficient to say "call mp3info for this file, call sox for this file", etc - but you'd also need to supply the proper calling format and the means to parse the output to get the info you want.

    This, I contend, is where an object-oriented interface is useful. You say "I want the title field from this audio file", and the shell
    1: Determines the format of the file. I'd like to have that information stored in a file's extended attributes - but files lacking that (files served over NFS or off a CD-ROM, or files on systems where people just don't want a bunch of Xattr's floating around for whatever reason) could provide the information in the file extension (UGH) or using file(1) magic.
    2: Find the code that tells the shell how to deal with the file. For an OO shell this would likely be a file format handling library - an interface to pre-existing utility libraries, written to work nicely with the OO shell. This library would need to provide various common interfaces to the files in question (for instance, provide a method to decode compressed audio, or tell the shell that a WAVE file is also a type of RIFF file) and provide more specific interfaces to things like format-specific (or even file-specific) data fields.
    3: Call the library, making the specified requests.

    The specific advantage this provides over traditional shells is that the OO shell can provide domain-specific help in obtaining the correct result. It would be possible, for instance, to have one command-line program to deal with each distinct audio format, and give them very similar interfaces, but then the script writer must take care to call the correct one for each file. It would be possible to create a master audio tool like "sox", but also give it plugin support and add plugins for all relevant file formats - but this just solves one particular case. Do we do the same for all image formats? All video formats? I think that kind of framework would be a good addition to the shell.

    the OO solution would be to ask each file for this information.

    I'm neither a fan of OO nor a fan of executable data that may have come off-host, but to each his own. In the case of file types, I am a fan of teaching file(1) about the format and letting it do all the messy work. Do one thing and do it well is ancient Unix wisdom more ignored than followed now-a-days, but this kind of stuff is what that program was designed to do. I do believe it is an utter mistake to judge file types by extensions.

    You misunderstand, I think. Your MP3 files are not executable. However, the shell does provide an executable interface to them through format-specific libraries. So you really jus

    --
    ---GEC
    I'm but the humble pupil, seeking to snatch the scratchbuilt pebble from the master's fully articulated hand
  122. Re:Windows "power shell"? by MS-06FZ · · Score: 1

    Exactly. Everything you could ever need to do on Linux, you can do from the shell if you know the commands. Windows? Most programs don't take command line arguments or run in command line mode. That's part of why cmd.exe is so useless. There are no apps that make use of it. There's also the lack of things like grep, sed, etc. in the cmd.exe that make it useless. Bash has all of that, and it has had it for ages. The PowerShell is just MS trying to make an actual useful shell like we have because the old one was so bad. Well, yeah. That's exactly right. MS made a good shell because they didn't have one of their own. They recognized that sysadmin types often liked having access to tools like bash and perl - and so they made something that provides that style of interface, but they gave it sufficient functionality to be able to interface with .NET stuff. That alone makes it necessarily different from traditional Unix shells.

    Whether the result is good or not is a matter of opinion. As a Unix user I find some of their decisions distasteful, but I can understand their reasons for making the decisions they did. (The verbose command names, for instance, probably help internationalization) - but I think the direction they've gone is a smart one. They've taken the Unix philosophy of small tools that work well in combination, and extended it so it can work sensibly with much larger, more complex datatypes. Managing that level of complexity benefits from using a consistent mechanism to represent non-trivial data structures. You could create a "consistent mechanism" any way you like, of course - define IFF tags for all file types on your system, encode everything in XML - whatever - and you could still pass the data over regular interprocess pipes. However, there are some implications to this. First off, when the data format becomes significantly complex, the "human readable" advantages of text formats vanish. Fields become populated with escape characters to avoid the use of delimiter characters, the mass of data becomes too large to sensibly view with a raw dump, (or, if you're passing binary over the channel, it ceases to be "human readable" through a console dump at all), etc. Second, you're passing much more data than you need to, which can get rather wasteful. A shell that knows how to pass structured data can make intelligent decisions about how to pass that data. I think in Powershell the basic idea is that the shell helps to determine the object's lifetime, but the actual hosting of the object is done through an object manager (think CORBA).

    I don't think Powershell provides any means to actually stream data. So the equivalent of "primes | head | tail" wouldn't work quite the same. (Actually, 'primes' would have to be written so as to return an object capable of generating primes, rather than as an endless data stream of primes. The shell expects 'primes' to actually finish running before calling 'head') I think it might be better to have a system where structured data can be streamed, so that programs in the pipeline don't have to wait for all the data, just the pieces they want.
    --
    ---GEC
    I'm but the humble pupil, seeking to snatch the scratchbuilt pebble from the master's fully articulated hand
  123. You want CORBA then? by jotaeleemeese · · Score: 1

    Let me tell you something: it did not work.

    Too complicated and confussing, you have to made up all the "common language" and the interface between programming languages becomes more complex than the code for the problem you are actually trying to solve.

    Text is easy to parse and backwards compatible, and if you organize it cleverly, it can represent objects (XML!)

    --
    IANAL but write like a drunk one.
    1. Re:You want CORBA then? by MS-06FZ · · Score: 1

      Let me tell you something: it did not work.

      Too complicated and confusing, you have to made up all the "common language" and the interface between programming languages becomes more complex than the code for the problem you are actually trying to solve.

      This is the reality of the world - if you want a meaningful, useful interface to your C or C++ module it's going to be a bit of work. Unless, of course, an automated tool like SWIG can do the job nicely for you. I've written Python and Guile bindings for C++ modules I've written in the past - it's a pain in the ass. But what you get for your effort is a version of your module that's transparent, interactive, and self-documenting. Very helpful for fiddling around and testing. Binding to something like CORBA or .NET is roughly the same idea. Languages like C#, Java, and others are designed to make this kind of thing easier by formally adopting ideas of what constitutes a module and how function definitions are exported.

      Uh, so yeah. Sometimes doing things is hard. But that doesn't automatically make them bad ideas.

      Text is easy to parse and backwards compatible, and if you organize it cleverly, it can represent objects (XML!)

      I have a co-worker who would certainly take exception to the assertion that "Text is easy to parse". His primary job around here is writing and maintaining... a parser. :) There are programs that do nothing but attempt to make the job of parsing text easier (lex and yacc, for instance) and still it's a difficult problem.

      Text can be easy to parse - if it's that way by design. The same could as easily be true of binary formats, however. Text is a lot easier to handle in current shells, however, because current shells were designed for dealing in text. It's a bit of a self-fulfilling premise. We have less, grep, awk, sed, perl, emacs, and so on - those are the tools that are making text such a convenient format to work with. It's not naturally easy to work with, we've just designed our shell environment around it, thus making it easy. A well-designed environment based on the idea of structured data would also be "easy" once implemented - but it would also be more powerful.

      XML could certainly be a candidate for an interchange format between processes - though maybe not the best one. Consider, for instance, Unix pipes. One of their nice features is that the first command in the pipe need only generate as much data as the second command in the pipe is willing to read. For instance:

      > primes | head -100 | tail -10

      will not run forever. Most likely the "primes" process will generate more primes than "head" is looking for - but it won't run forever (or even until it hits the largest prime number it's capable of calculating) - once it is known that "head" is finished processing its input, "primes" will stop generating new values.

      Now, this also applies if you're feeding XML data over the pipe, naturally. But suppose you had a process that was generating two sequences of values - and you wanted to stop processing after the first 100 of each sequence. I don't know enough about XML to know if there are established ways of representing that kind of operation - but there's no communication from the second command about what values it's waiting for from the first command, so the first command will most likely just generate the whole first sequence, then the whole second sequence - processing can't be finished until the first process has generated the entire first sequence.

      Add to that the fact that XML (In my opinion, anyway) basically negates one of the main claimed advantages of text formats - the ease of (human) reading/writing, and processing them - it's a basic consequence of a non-trivial data format, really. XML can be edited in a program like Emacs, of course, but Emacs isn't necessarily the best tool for the job. Often, it'd be more preferable

      --
      ---GEC
      I'm but the humble pupil, seeking to snatch the scratchbuilt pebble from the master's fully articulated hand
  124. That's not even a challenge. by sethawoolley · · Score: 1

    This is what you didn't want me to do:

    find . -wholename '*bath*' -print0 | xargs -0 rm

    nor this ('+' is an xargs-like operator to replace ';'):

    find . -wholename '*bath*' -exec rm '{}' '+'

    grep's -0 operates on output, not input since it's not needed (due to find having the capability already),

    two ways to do it with perl doing what grep would normally do but with null on input instead of output:

    find . -print0 | perl -0ne 'print if grep {/blah/} $_' | xargs -0 rm

    find . -print0 | perl -0pe 'grep {s/.*blah.*//} $_' | xargs -0 rm

    Now do it in powershell.

    Claiming that powershell doesn't mess up filenames compared to shell is missing the point because the find command is strong enough to support all file name (and file status) manipulation directly. "Please fix this, but don't do it the Unix way" is not a valid challenge. Passing filenames throuh pipes is not typical with the robust find command already, but there are -0-like switches for that just in case.

  125. Keep your shit by dedazo · · Score: 1
    Tell you what, you keep and enjoy your own "shit", and let others enjoy theirs. Game?

    Explaining WPS to you would be like trying to explain calculus to a cockroach. Except that the cockroach would probably find it mildly interesting.

    --
    Web2.0: I love when people Flickr my cuil and digg my boingboing until my google is reddit and I start to yahoo
  126. Xargs is the Devil's companion to find by SuperKendall · · Score: 1

    The other responder beat me to the answer - but I wanted to sound a further warning, that "xargs" is never the right thing to use in conjunction with find. As noted find has -exec (which you are supposed to use), but beyond just using a tool the way it's meant to be used I have seen limitations with xargs flaking out if a directory tree gets too deep. "-exec" will never run into an issue because it always runs in the directory of the target, and thus does not rely on a ginormous path + file being passed in.

    Xargs has other good uses (I'm sure, though I personally almost never use it) but find is not one of them.

    --
    "There is more worth loving than we have strength to love." - Brian Jay Stanley
  127. Re: Windows "power shell"? by MS-06FZ · · Score: 1

    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.

    Well, let me ask you this: why not invent one?

    For sure, I understand that people the world over aren't going to embrace a new system like that overnight. But people who use a shell who uses that kind of system would be fine with it. People write modules for Perl, Python, Ruby, etc. all the time - each of those is a scripting language with its own ideas about how to store objects. Do people feel "locked in" by Perl? I'm sure some do - but a lot of people are quite happy with Perl, and the CPAN has all kinds of code (Perl code and binary modules) that are good in nothing but Perl.

    Also consider this: once you make a data structure transparent in one way, it is easier to make it accessible in other environments, too. For instance you could say "here's a binary data file. It has a matrix in it" and people would get nowhere - or you could say "here's a binary data file. Its dimensions are (m) by (n), it's stored in column-major format, IEEE double-precision, little endian format, it's not a sparse matrix, and the numeric data starts at offset (x)." - a live object providing that information would make a very convenient starting point for importing the data into Perl, Python, or any other scripting language.

    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.

    My point is that binary "text" is readable specifically because we've established conventions and provided tools that make it readable. If you do the same for a binary format, the same will be true for that binary format.

    You can say that some live objects may not be serializable: that is certainly true. Sometimes they're too ephemeral for that, too specific to current operating informat

    --
    ---GEC
    I'm but the humble pupil, seeking to snatch the scratchbuilt pebble from the master's fully articulated hand
  128. Re: Windows "power shell"? by dhasenan · · Score: 1

    You can't invent a standard object format because it's only meaningful for a limited set of applications. The rest, well, you can sort and display based on fields, but you can do so with awk. With this, you just need to know the name of the field rather than the number of the column. And that's about it.

    General purpose tools now have to convert things to text or create some mapping between generic objects and particular objects. Or you have to implement objects as dictionaries, and just treat the field names as meaningless keys (which they pretty much are).

    I'm sorry, I just don't see much use. It's like template metaprogramming: probably useful in some edge cases, but probably not revolutionary for the average user.

  129. Where are those methods coming from? by jotaeleemeese · · Score: 1

    That is exactly the problem with the idea.

    sort can take input from du, ls, df, or arbitrary scripts, you only need to define the key for sorting and that is it.

    If you use objects the output of du is completely different from the output of ls, df or another arbitrary script, ther is no way a predefined sort method could deal with that.

    Thsi for sure means that you have to overload the methods to fit the data. So from one flexible, elegant solution we would need to move to a contrived one using obejcts where in reality we don't need them or they become a liability.

    The idea is interesting, but gut feeling is telling me that the MS approach of one size fits all may be pervading this.

    --
    IANAL but write like a drunk one.
  130. There are many wasys to do that in UNIX/Linux by jotaeleemeese · · Score: 1

    So you will have to come with a better example to get us exited.

    Making everything an object may be a solution looking for a problem to solve....

    --
    IANAL but write like a drunk one.
  131. Get proper terminal emulation software. by jotaeleemeese · · Score: 1

    Whatever you are using clearly doesn't cut the mustard.

    --
    IANAL but write like a drunk one.
  132. Re:PowerShell isn't a Shell It's a scripting langu by Flambergius · · Score: 1

    Actually, that is PowerShells biggest weakness as a integration shell.

    Ok, I know that is a sweeping generalization to grab reader's interest and you do back down from it later on and come away with somewhat sensible argument why PowerShell doesn't suit your specific case. However, your opening statement is a) wrong, b) dangerous and c) totally overrated, that I have to respond even if the discussion has already died.

    It is conceptual mistake to claim that a character stream is more generally useful abstraction ("a common lingo") than an object is. If you were to equate character stream and a bitstream then you could convincingly claim a character/bit stream to a lower level abstraction than an object, but I think it would be obvious to all that a raw bit stream is in fact not a very useful abstraction in most real world integration situations. It is however, far from clear are what the relative general merits of an object and a unix-style character stream, which is best understood as a mixture of character data, markup and positional information in integration situations.

    In structured programming, objects are the way to go. As you point up this may not be readily applicable to all integration situations. However, if the integrator has fairly good control of the whole environment, they will be in position to ensure that required objects are available. Anyone working within an organization will have that level of control, assuming they are working on an authorized project.

    In my mind using PowerShell is very important decision that should be made by people responsible for general IT strategy, however it is also a tool that could make many things a lot easier in a mixed window-*nix environment. Increases in productivity, both form increased efficiency and increased production, could be huge. It is a tool that you will ignore at your own peril. Everybody should be aware of it, if only so that they won't be blindsided by development to come.

    --
    Computers are useless. They can only give you answers - Pablo Picasso
  133. Re: Windows "power shell"? by MS-06FZ · · Score: 1

    You can't invent a standard object format because it's only meaningful for a limited set of applications.

    Nonsense. People invent data formats all the time. There's a long path to making something "standard" (whether "de facto" standard or approved by some standards committee) of course, but it can be done. This is how progress works - you have to go out on a limb, try something that may not even work, sometimes something that's so alien to people that they're very resistant to the change. And if it works out, then maybe in a few years it'll start to become popular.

    The rest, well, you can sort and display based on fields, but you can do so with awk. With this, you just need to know the name of the field rather than the number of the column. And that's about it.

    This is true for very simple data structures. However, this is nevertheless a piece of information about how the data is structured which is not accessible in any way from the data itself. The thing about a "standard object format" is that it doesn't need to mandate how data is stored, just how information about the format of the data is communicated. Bash doesn't tell anyone anything about the format of data that goes between processes. It can't, it doesn't know how. If it wanted to, it'd need cooperation from the programs in question, and it'd need some mutually agreed-upon means of communicating that information.

    Let's suppose you had a shell program that did nothing but parse C++ source code for other programs. That's all fine and good, but how does it output the result, such that it's both a complete representation of the source, and an easier form for other tools to work with? Some XML format might be a candidate - though requiring your tools to all handle XML is a fairly steep demand.

    General purpose tools now have to convert things to text or create some mapping between generic objects and particular objects. Or you have to implement objects as dictionaries, and just treat the field names as meaningless keys (which they pretty much are).

    But in text pipes, you are not just converting data to text at your last step, you're converting back and forth on every step.

    If I'm just grokking /etc/passwd or a crontab, that could be perfectly fine - the file format is so mind-numbingly simple that there's not much to think about. Truly extensible file formats, extremely large files, and so on, are a different matter. What if I wanted to apply the pipelining system to a 2GiB numeric matrix? Or audio data and/or video data that I want to process and encode?

    The answer is, of course, that this sort of thing can be done, and in some cases presently is done with traditional pipelines. Behind the scenes, for instance, mkisofs may be piped to cdrecord, or mp3 decoding may be piped to ogg encoding - this stuff is used and does work. I would characterize the advantages of an OO system in this case as follows:

    1: Data type checking, and autoconversion: Let's suppose you did something stupid and passed raw MP3 data to a program expecting only uncompressed WAV data. Most likely the receiving program will quickly realize the incoming data is not a RIFF format, let alone a WAV file, and reject it. But there could be cases where this isn't so easy. Suppose you're passing a buffer of numeric values - single precision floats - to a program expecting double-precision floats in a different byte order. There's no way to catch that. But if the sending program can communicate about the format it's providing, and the receiving program can communicate about the kind of data it's expecting, then the shell can act as an intermediary - implementing a consistent set of rules for what to convert and how, when to present the user with a warning or error message, and so on. If you did something really stupid, like sending MP3 data to a program expecting a text file, the request would be rejected. MP3 data isn't t

    --
    ---GEC
    I'm but the humble pupil, seeking to snatch the scratchbuilt pebble from the master's fully articulated hand
  134. Regexps by MS-06FZ · · Score: 1

    Well, that's good to know: the thing is, the versatility of the shell in approaching different problems is of more interest than the specific operations that are made convenient. You've demonstrated that changing the extensions of files is a bad example - because the "ren" command provides a convenient means of doing that. Whether Bash's flexibility is compensation for insufficient specialization for common operations - or whether cmd's specializations are compensation for insufficient power in the command language is kind of debatable, and largely a matter of opinion.

    But the power and versatility demonstrated in the Bash example - the ability to evaluate a substitution inline, mainly - I think that was the point of that post. We want to know what the equivalent to that is. There's bound to be some other case where an inline substitution would be handy - a case in which maybe CMD doesn't offer any specialized tool for the job.

    --
    ---GEC
    I'm but the humble pupil, seeking to snatch the scratchbuilt pebble from the master's fully articulated hand
  135. Re:It's funny that you so highly praise ...LISP. by MS-06FZ · · Score: 1

    The "repeating pattern" is that as people encounter specific problem domains, they devise tools that are particularly suited to solving the problems. LISP could possibly encapsulate everything everywhere - maybe - but as a language LISP isn't as nice for interactive shell sessions as bash, it's not as efficient for expressing text processing problems as Perl, it's not as well suited to exploring and expressing a wide variety of object concepts as Python, etc.

    The problem is, LISP can't nicely encapsulate all these different, domain-specific data formats. That's why domain-specific solutions exist in the first place. But, maybe more to the point, it doesn't. Even if it could, it doesn't. There's a big difference between something being possible and something existing as a readily-available solution. Yes, it's possible that a modern system could be built entirely around LISP. It might not be a bad idea. But unless such a system exists, that's meaningless. So who cares? Either write this environment, and prove its greatness, or else kindly acknowledge that while you think a system revolving all around LISP would be dandy, you have nothing more than idle speculation to base that on.

    Did LISP in 1958 unify data transfer between digital audio applications, 3-D mesh editors, bitmap and vector graphics editors, word processors, video codecs, and spreadsheets? Of course not. Maybe things have gone downhill since then - if you prefer to think of it that way - and we're just now starting to reintroduce common communication formats back into computing. Whatever - I wasn't even born in 1958. Object-oriented command shells are, as far as I'm concerned, a nice improvement over command shells I've used in the last fourteen years since I started using PCs, so even if you somehow consider this thing a reinvention of LISP (seems like more than a bit of a stretch to me) it's still progress over the current state of affairs.

    --
    ---GEC
    I'm but the humble pupil, seeking to snatch the scratchbuilt pebble from the master's fully articulated hand
  136. Re:PowerShell isn't a Shell It's a scripting langu by ratboy666 · · Score: 1

    Thanks for your comment. Yes, the opening statement is a "flame-ish" punch to get attention. My signature does mention "insightful troll", as a reflection of writing style.

    And, I do say that PowerShell can be the best thing since sliced bread where it's appropriate. You are correct in that when all methods are available, PowerShell can be used as a fantastic integration tool.

    It still fails in "ad-hoc" usage, except where "ad-hac" means common desktop command line use.

    For my purposes (reading others log files, mostly), the Unix paradigm works better. And PowerShell also works here, but only as an implementation of the Unix paradigm. The object nature doesn't help (yet -- maybe log file implementors will introduce an object classification that everyone can agree with).

    Have a GREAT weekend!

    --
    Just another "Cubible(sic) Joe" 2 17 3061
  137. Re:Windows "power shell"? by Anonymous Coward · · Score: 0

    Access the gui? Why, did somebody strand a bunch of functionality in "the gui" where scripts can't access it?

    Nah, nobody would ever be that stupid.

  138. Re:Windows "power shell"? by try_anything · · Score: 1

    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.

    Yet handling these steps seems more practical than trying to share data format definitions between languages.

    Every language that takes part in a Unix pipeline has to handle text -- awkward, but doable.

    Every language that takes part in the object pipeline you describe has to have a shared way of defining structured binary data -- historically, a huge tangled problem that has probably spawned more short-lived and nonstandard "standards" than any other kind of computing problem. These "standards," despite being intended to enable compatibility, have caused more incompatibilities than any other kind of computing technology.

    In this case, text is the best solution, perhaps because it isn't a solution at all.
  139. Re: Windows "power shell"? by Anonymous Coward · · Score: 0

    Well, let me ask you this: why not invent one?
    Why bother inventing one when there are dozens of mutually incompatible ones to choose from? While you're at it, try inventing a universal object model to allow all object-oriented languages to interoperate. Oh, I know, all you need is a least common denominator.... Being the first to think of that, I'm sure you'll be the first to succed at it, too.
  140. The functionality gap between GUI and command-line by MS-06FZ · · Score: 1

    Access the gui? Why, did somebody strand a bunch of functionality in "the gui" where scripts can't access it?

    Nah, nobody would ever be that stupid.

    Heh. Actually, I think almost everybody was "that stupid".

    MacOS started out as a system that was built from the ground-up with the assumptions of their GUI (hence, filesystem supporting things like forks and resources and a formal notion of type IDs for files) - it has since switched to a more hybrid approach - retaining some of that (including the HFS filesystem) but mostly for backward compatibility - new Mac stuff is designed for lesser assumptions about the filesystem so that the OS will work on HFS but also play nice with other filesystems.

    Windows doesn't really have a distinct notion of what defines the "GUI environment" and what defines the "Command-line environment" - the whole system is built around the assumption that the GUI is running on a display somewhere. The underpinnings are reasonably modern and getting better - though filename extensions are still used to infer types, and if you were to consider Windows versions of bash or cmd.exe to be the "Windows command-line environment" then the separation in terms of concepts and functionality is pretty severe. But then you've got powershell, of course, which is like a somewhat Unix-ish shell (mainly in the general concepts of the prompt, the PATH, the filesystem, and command structures like piping) but deeply rooted in Windows technology and style - perhaps the system with the least "split personality disorder" between the text interface and the graphical one, surprisingly.

    And then there's Linux. The GUI is being built up as a sort of mimicry of Mac and Windows, with a few old-school X-isms thrown in for good measure - Gnome and KDE each include their respective scripting interfaces (ORBit and dcop, currently) but the components that make up Gnome or KDE are often considered separate from the system - people still write X apps that aren't integrated into or compliant with either environment, and I think many people don't like to incur those dependencies for fear of over-complicating their program or limiting it to just the people who use that particular environment to begin with - so neither system is treated like an assumption, it's strictly an add-on and largely self-contained within its community. Straight X apps and console apps tend to make very few assumptions beyond the POSIX-like system call environment and filesystem, the standard C library, and the terminal or X server. Few projects outside of GNOME or KDE projects assume the presence of an object broker or any particular RPC or IPC mechanism, let alone the more advanced concepts these frameworks implement, such as scriptable application interfaces, data exchange, and so on.

    Put simply, it's my contention that on Linux, the GUI frameworks are creating an environment which, from the point of view of the command shell, is fiction - an elaborate facade built on top of machinery that is adequate for the task, but not well tailored to it. What I advocate is not necessarily that these technologies be embraced to create a more specialized shell environment (after all, the changes in Gnome and KDE are a little unsettling if it's stability you're after - KDE dumping CORBA in favor of their dcop system - Gnome possibly dumping CORBA in favor of Mono in the future - apart from the fact that people often don't want these technologies to be a part of the basic assumptions on their system, the technologies simply haven't settled to the point that this is practical...) - but rather a shell environment with sufficient powers of expression and representation to be able to interact well with these technologies. What's missing is the ability for the shell to host and exchange "objects" (meaning, pieces of data - not even necessarily in an OO sense) that have specific requirements for managing their "lifetime" (code to be called when the data is copied or deleted, for instance) Beyond that, wha

    --
    ---GEC
    I'm but the humble pupil, seeking to snatch the scratchbuilt pebble from the master's fully articulated hand
  141. My own, insane plans for an object-oriented shell by MS-06FZ · · Score: 1

    Dude, you totally rock. I love your response. It's a perfect criticism and I love the delivery - with just a hint of sarcasm at the end to drive the point home. It's a pity you posted anonymously - but I don't hold that against you.

    The person I was replying to suggested that there was no "universally agreed syntax for objects" - which is true. The point I was trying to make (and not making well) was that such a format doesn't need to be "universally agreed" upon, standardized, or pre-existing. If we want progress and have a good idea of what form we want that progress to take, we can build new systems as necessary.

    As for creating a new format - if none of the existing ones are really suitable it's the way to go. The plan for the format is based on three key features. First is the ability to wrap established data types for identification. Second is the provision of an adequate set of data types (numbers, text, lists, tables, structures, and objects) to allow information to be expressed in a generic manner. Third is versatile streaming order of data, to allow more versatile pipelines. A metaformat that provides significantly more than that is overkill. A specific format that provides less than that is inadequate.

    As for my assertion that no existing formats meet my needs - well, it's an assumption, really. I'm trying to be sure that it's the right conclusion. This means research. But defining a new and compact format that I know is well-suited to what I'm trying to do may be more productive than hunting for one that might be well-suited to what I'm trying to do.

    It's quite possible that I could accomplish what I want in some binary encoding of XML - or, rather, use the assumption of an XML encoding as the outermost "layer" of the data as a way to reliably communicate the fact that the contents are in this new format I want to produce - that would have the advantage of playing nicely with all the code out there that looks for XML, at least. It's sort of like going to China knowing no phrases in Mandarin or Cantonese other than "the rest of what I am about to say is in Esperanto." - but that is the whole idea here - tell whoever's listening what language the speaker is speaking - whether that language is PDF, XML, MP3, whatever. I'm not sure if I would want to go that specific route, however.

    --
    ---GEC
    I'm but the humble pupil, seeking to snatch the scratchbuilt pebble from the master's fully articulated hand
  142. Wake up! by Anonymous Coward · · Score: 0

    irb, IDLE, beanshell...