why Unix?

Yigal Chripun yigal100 at gmail.com
Wed Apr 8 14:43:02 PDT 2009


On 08/04/2009 18:10, Steven Schveighoffer wrote:
>
> This does sound useful. More so than was explained, sorry to Yigal for
> being so inflammatory, but what can you expect when you say Unix is a
> "stupid" design ;) It's just a different design, one that works very
> well for script writers.
>
sorry for not explaining it more clearly the first time. Thanks again to 
Daniel who helped clarify this. :)

>> I won't say that "everything is a file" is a failure, but powershell
>> *definitely* exposes a superset of UNIX's functionality. Anything you
>> can do with a UNIX-style environment, powershell can potentially do
>> better.
>
> This kind of thing is useful only for cases where OS objects were
> converted into strings (such as via ls), actual files still have to be
> read and parsed I'm guessing. But having .NET at your disposal gives you
> a lot of potential parsers for things like XML files or whatever.
>
> BTW, /proc is a lot like this. You don't need to have a manual to
> understand what it means, since you can browse through it just like any
> other directory. However, there are some files that have undescribed
> values in them, where you do need a manual. But these files are built to
> be parsed for the most part, so it doesn't take a lot of work to get
> information out of it. I think the advantage to having everything be
> represented as files is that you already have a bazillion tools to
> manipulate and parse files in unix. The same is not for Windows, but it
> does have .NET which has a great API to OS objects.
>
>> Microsoft really hit one out of the park with powershell, although it
>> remains to be seen if anyone will actually use it.
>
> It sounds a lot like it is geared toward .NET programmers rather than
> script writers. Do you use it?
>
> -Steve

powershell has its own syntax specifically designed for scripting. It's 
integrated with the platform but it is geared towards script writers.
powershell allows:
a) you can call external programs just like in bash
b) you can write scripts in powershell just like you'd do with bash 
using the powershell language.
c) you can extend powershell with cmdlets -
cmdlets are .net (C#) classes that implement a _common_ interface.

you do not need to parse any files unless you use external programs.
fo example, let's look at "ls | grep ..." :
ls, grep, etc are just aliases for cmdlets, which are clases that can 
communicate with objects and no file parsing is required between them.



More information about the Digitalmars-d mailing list