Linux-flavored Windows
eamann.com
eamann.com
On top of it, you can download compilations of standard gnu unix untils at sourceforge compiled for windows. I have a standard unixutils folder on the c: root of the drive of all my computers so I can easily access stuff like wget, netcat, grep, etc. Works well enough.
For a newcomer, no, Cygwin is not a breeze to install and use. The documentation is abysmal, the download takes forever (unless you know ahead of time which tools to install and which to omit), knowing which packages to install to enable specific features is impossible for someone without experience, and there is no native uninstaller.
For the sake of sanity though, I use Linux with a windows VM.
This is almost entirely because it uses the CLR which has terrible inefficiency due to immutable strings, the CLR startup time and insane cost of reflection.
That's true, PowerShell is slower than bash. It does more, and that has a cost.
That said: it's by far the best designed shell in terms of syntax, and actually separating presentation from logic.
Eg, print me a list of processes started in the last hour (from memory, I don't normally use Windows)
ps | ? StartTime -gt $1HourAgo | kill
Notice the lack of silly things like creating regexs to represent time?Unix shells are MS Word. Powershell is LaTeX.
(This is pretty much a textbook example of the New Jersey worse-is-better style...fitting, since it involves Unix directly.)
1. It can throw a message box or prompt on the screen without any notice. Precisely how this is handled from a scheduled task is "interesting".
2. If you're non US locale, you get different date formats pop out of get-date, gci and CLR DateTime. This at some points in time scares the living fuck out of me as an implicit cast to string can swap day/month around.
3. Changes every year or two. Features features features. Gotta learn them all. Pokemon time.
4. Module system is a piece of shit.
5. Signing is so friction inducing that everyone just turns it off to get shit done.
you compare to bash here. Bash doesn't do much at all. This is the point. It leverages other tools to do the work. In your example you mention regex for parsing dates. This is a bad approach. "date +%s" returns sortable integers which you should work with.
PowerShell is Word. LaTeX is a felt tip. Bash is a fountain pen and a steady hand.
> "date +%s" returns sortable integers which you should work with.
Date returns text, not integers. Your shell doesn't understand that there are not more than 60 seconds in a minute.
You might argue that people shouldn't use a shell to parse dates, and pass the text onto a proper tool to read it. That doesn't change the fact that Unix admins, like Perl developers, try and do this all the time. Maybe the best thing about posh it stops people from doing stupid things.
The LaTeX/Word analogy was simple: powershell separates content from presentation. bash does not.
Now explain how to write a "ps-like" command which emits mostly the same stuff and coexists in the same universe. Now things flip: unix is straightforward and easy (everyone understands how to emit text, and you can do it from literally every programming environment there is) and windows is arcane and inscrutable, and works only with whatever .NET framework understands that log stream.
Fast forward a few decades, and examine the size of the ecosystems built around "simple tools and text streams" vs. "custom logging format plus cute syntax".
It's a forest for the trees argument. Microsoft, as always, optimized for the wrong part of the problem. In this case: the admin experience is great, at the expense of the developers of the tools those admins would need to run.
Yes, exactly.
There are far, far more users than complementors (tool creators) in this space. Optimising for users is excellent, and smart tool creators will see and appreciate the benefits.
Where is the powershell ecosystem? It doesn't have one, sorry. Syntax can only take you so far, and as I pointed out Powershell designed for syntactic power at the expense of extensibility. And it made the wrong choice.
A decent syntax is orthogonal to extensibility: Powershell uses .net because Microsoft likes .net. A Python, Ruby or node-based equivalent wouldn't use .net, and still have a clean syntax.
The author mentioned in the very beginning of the article that they wanted something that would work cleanly across their other (*NIX) platforms. Powershell, while fantastic, is not cross-platform.
And Cygwin does some funny stuff that also makes client configuration a bit of extra work if you're, again, dealing with multiple platforms.
Edit:
> using a text-only interface is extremely foreign.
Oh I see, he's newb (as in the normal meaning of the word, not mocking). That explains.
For the lazy there is http://bliker.github.io/cmder
http://gnuwin32.sourceforge.net/
DISCLAIMER: I just copy/pasted the steps to install GnuWin32 from a text file with instructions that meets my needs. This means that I deliberately did things that the documentation doesn't recommend (setx /M PATH...), so I suggest to read the documentation first.
download.bat
install.bat C:\GnuWin32
xcopy /i /e /c "C:\GnuWin32\Start Menu" "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\GnuWin32"
setx /M INFOPATH C:\GnuWin32\info
setx /M WGETRC C:\GnuWin32\etc\wgetrc
setx /M A2PS_CONFIG C:\GnuWin32\etc\a2ps.cfg
setx TEMP ^%USERPROFILE^%\AppData\Local\Temp
setx TMP ^%USERPROFILE^%\AppData\Local\Temp
setx TMPDIR ^%USERPROFILE^%\AppData\Local\Temp
setx /M LANG EN
setx /M LANGUAGE EN
setx /M PATH "C:\GnuWin32;%PATH%I still would recommend it as a "Good Thing" to have, much like sysinternals ( technet.microsoft.com/en-us/sysinternals/ ) if you're on Windows.
If you're serious about using Vim on Windows, check out gvim (http://www.vim.org/download.php#pc) which adds some nice Windows integration.
I would also echo the author's point about avoiding Cygwin. It gives you the worst of both worlds: you can't access Windows facilities, and many Linux programs don't quite work right. By far a better solution is to use a native Windows shell (Powershell) together with native Windows builds of various GNU utilities (from a Git install, GnuWin32, MinGW, etc). Powershell gives you fluent access to a wide variety of Windows-specific API's, and you don't have to sacrifice the convenience of a Linux command line environment.
Secondly, if you like MSYS (which is the environment bundled with git usually), then you can just download it directly. That way you can choose which tools you'll want, and stay up-to-date.
edit: interesting how many people seem to be more familiar with gnuwin32 than msys, considering that gnuwin32 seems pretty dead as a project and never was as comprehensive as msys.
It's kind of like some of this with some other stuff thrown in -
You could achieve the same ends by installing msys standalone, but I guess many already have Git for Windows so this is a simpler path.
The key benefits msys has over cygwin, from my experience, are how lightweight it is, and how easy and fast it is to set up. I wrangled with cygwin for far too long (for no good purpose) before switching to msys and then GNU/Linux.
If Ubuntu is not your cup of tea, there are other user-friendly distros.
I agree that this is a weird article, but I also like the idea of adding the git bin to path. I'm going to try that.
Maybe I have to remake a ssh using Node. Node has a NICE tty port.
Not quite sure what you mean.You don't need to use comma unless you explicitly want an array of values. So for example a rather simplistic cmdlet/function like this,
Function Foo([string] $text, [int] $count) {
#Produce repeated text
$text * $count
}
can be called in any of the following ways: Foo "ab" 3 ---> "ababab"
Foo -text a -count 3 --> "ababab"
Foo -t a -c 3 ---> "ababab" [Automatically disambiguated]
And we are not even using features of cmdlets like parameter aliasing.Maybe I understood your concern wrong?