I was thinking about pros and cons of unix and about comparison Unix shell (bash) and unix commands with Windows PowerShell and its commands. I just would like to hear what do you mean about:
Aren't options of unix commands too much confusing? Why are not standardized in a way that it's "easy" to guess what option one need. It seems to me that unix scripting is a thing where you can "enjoy yourself" but you have to be still worried about type of distribution and so on - isn't it actually drawback?
I've tried Windows PowerShell and I was quite surprised about power of the shell and that the authors tended to use quite similar syntax and similar names of commands (tee command). On the other hand if you want to change the wallpaper you pretty much need to know how to do that - so it's quite complicated what matters "system settings". What do you mean?
I'm just curious what do think people who do with unix daily.. I just study unix for an exam and use windows normally so I can't properly judge the advantages and disadvantages of unix..
For a start windows runs only on one type of processor or its clones...
have you seen winXX running on pa-risc, motorola 68XXX, or power-pc etc..?
windows is one OS, *x are many OS that have many common things... have you tried to execute a win batch on an unix? it fails... and how much work is involved to porting?
a *.sh on any unix platform should run with minimum of adaptation...
Windows developed Powershell as a response to developers installing linux or cygwin (free unix that runs under windows) in order to be able to manipulate text and files easily. There used to be a windows toolset that was a port of basic unix tools.
The reason is that every OS has good and bad points. You choose what you want to live with.
Those windows add-ons are there to get past windows deficiencies. The java virtual machine is a classic example. Linux Gnome and UNIX Xwindows, etc., behave very much like MS windows and are later add-ons in the same sense - in this case getting past user interface issues in UNIX. UNIX did not have MS-like windowing software to start with.
And these are just the user interface issues. And functionality.
There are a lot of very important issues with Windows and security for example. My company interfaces with the internet only via UNIX/Apache Tomcat, a firewall, NAT, etc. because putting a Windows 2003 server out there was not a safe idea. UNIX is cheaper and probably easier to harden.
Windows was and is primarily a single user OS, UNIX is multiuser. This gives rise to features and problems as well.
This whole discussion is analogous to: which is a better motorcar: Mercedes-Benz or BMW? It boils down to personal opinion and experience. There are other threads like this - what is you favorite <fill in the blank>. There really isn't much content in threads like this one. And they tend to start flame wars.
The observation you're making is that Windows Powershell is very consistent. Commands are easy to understand and have consistent options across the commands.
What you should realize is that Unix is a collection of tools written by lots of folks over many years. So there isn't much in the way of consistency. Tools were written to achieve a task and then passed to others who either used them, expanded them, or even provided their own versions (grep, egrep, fgrep).
A quick wikipedia check shows that Xerox came out with the first GUI as we all know. Then Apple with the Mac in Jan of 84. The X Window system came out in 84 as well with Microsoft following (as always) with Windows in 1985.
So Microsoft just saw a tool being installed (cygwin for instance) and their existing tool wasn't up to the job (otherwise cygwin wouldn't have been created just like other Unix tools) so they came out with the Powershell.
I don't keep up on everything but the Windows admin at work tells me that Windows Server 2008 can be installed as a cli without the gui.
Personally I started out as a typesetter. Everything was a code to format the text. Font size, type, center, etc but no WYSIWYG. I learned how to program on the Radio Shack Color Computer. My first computer job was programming on a Franklin (Apple II clone), TRS-80, and Leading Edge. So I seem to be very command line oriented. I feel a GUI for more than simple tasks (like typing in text on a forum ) to be overly complicated to use
I do feel there is a place for a GUI. I have a Mac Powerbook with my music and I have fun with my Windows box with the three monitors for programming and gaming. I have cygwin installed and currently have three windows open to my personal servers. But the servers aren't running a GUI either and I make it a point to identify and remove running Window sessions on my Linux and Solaris servers. It's a 1U or 2U in a rack with no monitor, why the heck is a GUI running on it?
Anyway. I find CLI to be easier for me. A man page tells me exactly what I need and I can script out tasks.
> What you should realize is that Unix is a collection of tools written by lots of folks over many years. So there isn't much in the way of consistency. Tools were written to achieve a task and then passed to others who either used them, expanded them, or even provided their own versions (grep, egrep, fgrep).
Yeah, sure, but I didn't notice it tends to the same consistency as on Windows lately. I mean the development of that tools continue but there's no tendency towards to consistency - that's actually what is this discussion about.
But it's still not a single group or company that are creating tools on Unix so there wouldn't be consistency. In fact they'd probably continue to use the same options and just add more to increase the functionality of the tool.
Because of that though, I can expect tools to work similarly on different distributions of Unix. There may be additional options but if I run "ls -la" on any box, it'll still produce similar output. It's not always true. "ps -ef" doesn't work on BSD just as "ps -aux" doesn't work on Linux. And "df -k" has different output on HP-UX (use "bdf" for similar output).
But I wouldn't expect HP to change its "df" to have a more common output. Same with Sun or whatever distro of Linux you happen to pick up although with GNU I'd expect some similar functionality of individual tools. But not commonality of switches across GNU tools. It's still a group of people doing their own thing.
As long as Unix was a product of Bell Labs, they had a coherent, close-knit community producing the tools and developing the philosophy. Some of their designs are still the state of the art, others could in retrospect have been different. The Powershell developers have the luxury of a clean slate and a knowledge of history (including Unix history, quite apparently) so they would be stupid not to avoid some of the obvious mistakes. If the thing takes off, there will be less cohesion and new problems as the toolkit gets more widespread use, but hopefully, the mistakes and problems will be different this time over.
I'm not too familiar with Powershell but from what I have seen and heard, it does take the Unix pipeline concept to a new and much improved level of coherence and abstraction. Too bad it only runs on a halfling OS, for now ...
I won't be dragged into a windows verses unix discussion. I'm a Unix guy but my company uses both and so Windows expertise is valuable to me. This includes the ability to script on Windows and that is why a discussion about Powershell is interesting. Mostly I script in bat files on Windows, but when XP came out, I took the trouble to learn VBS/WSH as well. VBS is a powerful language, but Microsoft seems to have pulled the plug on it and introduced Powershell instead. I am reluctant to learn another language that may be discarded in a few months. Is Powershell really worth learning?
Era:
> The Powershell developers have the luxury of a clean slate and a knowledge of history
The whole discussion is about if to renew unix tools or not. And I know it's a courageous question from a man who learns it a few months but I think the question is relevant with the arrival of Windows PowerShell.
Perderabo:
> Is Powershell really worth learning?
I don't think it's time to say there's Windows PowerShell Comunity Technology Preview 2 and the tool is developing. But for my purposes it's quite good.
Personally, no. I guess to be confused, I'd have to have expectations that they were common across the board. Since I don't have that assumption, if it's something new I'll check the man page for a description and which options I want to use.
I think this has been answered a couple of times at the utility and command line switch level. In general I expect there'll be a few differences. Heck, korn shell doesn't work exactly the same between Solaris and HP-UX. I write scripts for the OS I'm most comfortable with and adjust as I get to other systems. Eventually I'm aware of the gotcha's between systems and compensate for it in my scripts with:
if [[ $OS = "SunOS" ]]
then
...
fi
I'm not writing full fledged applications. Just scripts to check for things. Logs are located in different places on systems so I have to have a OS check to see if messages is in /var/adm, /var/log, or /var/cluster/members/member2
If it's a larger script, I'll use perl which is the same across platforms and has the tools within it to mirror what the utilities do.
That's great for you. As I'm a Unix admin, I have five flavors of Unix at work and four at home not including the Cygwin installations. I have cygwin on my Windows boxes so I have similar commands across all the systems I manage.
# find / -size 10000000c -exec ls -l {} \; | sort -k2 -n | tee /tmp/report.txt
It probably can be better but that's off the top of my head.
# cd /html; tar cf - *.htm | (cd /temp/project; tar fx -)
From an advantage point of view, it's there on all the Unix platforms I manage. While the command may differ from place to place, I know the command is still "find" and not "get-childitem". If it doesn't work exactly as expected, I can refer to the man page and find the odd option.
The disadvantage is what you observed. You may have to do some searching when you go to a different system.
The disadvantage for me of learning Powershell is that it's only on Windows systems and I haven't managed Windows systems since NT 3.51. If it comes over to a Unix platform, I might take a look.
The "beef" is that the pipeline stream consists of "objects" that you can "query" instead of just static text. This is an idea with an enormous potential, and a very clever way to distill the Unix pipeline concept. The precise syntax is obviously just a superficial artefact. But it would be good to see more examples, especially ones which are challenging to do on Unix.
The fact that you cannot guess option names is not particularly anything that is specific to Unix; I would predict that the same phenomenon will happen to PowerShell if it becomes popular. But certainly it needs to be said that the more you have to keep in your head or look up as you need it, the higher the threshold and the steeper the learning curve. I would regard it as rather elitist to assert that this is not a problem.