It's really, really, <i>really, really</i> really bad.<p>It doesn't even have a logical history. Despite having used it for many years, I still don't understand why when I type one command (eg make), and then another (eg out.exe), I have to toggle between pressing up or pressing <i>down</i> from the new command-prompt to access the previous commands.<p>I can't make the window more than 80-characters wide dynamically. (I don't want to change settings and restart the program to get the width to change.) So any time I want to copy and paste one of the infamous wall-of-text C++ template errors, I have to waste a lot of time reformatting the text.<p>Copy-and-paste as well is just complete garbage that takes forever.<p>I have to dump batch files into a folder in PATH because there's no alias support nor .profile startup script.<p>I can't color-code the prompt separately for visibility. There's no tab-completion. There's no shell escaping backticks. On and on.<p>Batch scripts are just hopelessly broken. It really feels like we're abusing the hell out of them to do things they were never intended to do. The language is closer to Malbolge than C.<p>PowerShell is a whole other can of worms. I don't care for it either, but that'd be a separate discussion.<p>Bash on Windows sounded promising, up until "Windows 10 only" and "doesn't play nice with the regular Windows environment."
In computing, "batch" connotes long running processes in addition to "script"'s connotation of collapsing multiple commands into a single one. The seemingly redundant parsing by the Batch interpreter is a feature, not a bug.<p>1. The parser allows modifying a .bat file during its execution and having those changes execute without restarting the Batch interperter. [1] This is in keeping with the rationale for batch processing -- facilitating serial execution of computationally expensive operations.<p>2. The Batch interpreter allows self modifying code.[2] In the early 1980's when Batch was designed, sophisticated COBOL programmers might have felt right at home. Lisper's were probably more hit and miss.<p>This is a case where historical context is useful. Today, it might perhaps be worth mentioning Powershell in a discussion of the Windows command line. Batch was the DOS command line and exists in Windows for evolutionary reasons.<p>In the days when abundant RAM and fast CPU speeds were prefixed with "mega" and distributed computing often happened at BAUD rates, not restarting a process was a big deal. More importantly, then as today, the execution speed of the batch interpreter was not a critical section of a batch process.<p>[1]: <a href="https://stackoverflow.com/questions/906586/changing-a-batch-file-when-its-running" rel="nofollow">https://stackoverflow.com/questions/906586/changing-a-batch-...</a><p>[2]: <a href="http://swag.outpostbbs.net/DOS/0019.PAS.html" rel="nofollow">http://swag.outpostbbs.net/DOS/0019.PAS.html</a>
Powershell is garbage. .Net does utf8 by default but powershell, built on .Net, manages not to.<p>Try type utf8Encoded.txt > out.txt in cmd.exe and posh. Cmd works and posh fs it up.<p>And after you do figure out utf8 encoding in posh, it'll always add a BOM just to screw you
Agree about Windows command prompt being lame compared to bash, but I really find PowerShell amazing, even more so then bash. If you look at all the recent (even not so recent) products from MS, it is clear that PowerShell is the shell for Windows, and not batch. I didn't get the cure for polio analogy that's in the article but I really think anyone that's comparing shells should compare with PowerShell.
I get perverse joy out of using the Windows CMD.EXE shell (and the earlier COMMAND.COM from MS-DOS). Yes, it's tremendously crufty, idiosyncratic, and sometimes seems down-right illogical in its behavior. Arguably, just about anything else is better, but it holds a special place in my heart.
This isn't completely related to Windows command line but I thought I would post it out here.<p>I was trying to run a Bash script from a Git repo mounted in a Docker container. When running the Bash script, I kept getting all kinds of errors. I ran the exact same script in the same Docker container on a different Linux computer that had cloned the repo. It turns out the \r Windows line endings (which I later normalized in Git settings) caused my script to barf.
Personally, one of the reasons why I fell in love with Ruby 10+ years ago was because I realized I could use it instead of CMD or bash to write all my scripts from now on. Regardless of the platform. Obviously, this applies to Python as well if that's more your thing.<p>I've never gotten into PowerShell but I have absolute respect for the concept behind it, and how much more advanced it is than any shell you can find on UNIX. Think about it: instead of piping several commands through an unspecified string protocol that varies between each command (essentially what UNIX does), you are now piping real language objects in a uniform binary protocol defined by the shell itself.
It's absolutely laughable. But I've almost come to see this as a feature - It's so terrible that no one relies on it or uses it. Bash in my opinion is overused.
I usually write shellscripts in PHP. Works pretty good, and PHP is by far easier to write than either bash scripts or Windows shell script - not to mention that one single syntax can be used for both OSes, which is nice when you do development on both Linux and Windows, and even nicer when you're also developing on OS X which ships a horribly outdated bash (and other coretools).
Its good enough to bypass UAC & AV and run whatever you like.<p>You dont even need to give your software a ".exe" extension to run code.<p>Just rename a program removing its .exe extension, then call it from the command line. It will run!<p>Its perhaps better to compare dos BATch files with bash.
just in case, <a href="https://mridgers.github.io/clink/" rel="nofollow">https://mridgers.github.io/clink/</a><p>only 600kb to enjoy your sanity back
I honestly feel like I am missing something. What is the current excitement about bash on Windows? It's been available (and something I commonly use) via cygwin for years. And cygwin's bash can run .exe binaries.
There are, of course, choices beyond Bash, Batch and PowerShell.<p>I'm a Microsoft fanboy and I find Python far more structured and faster than any of the above for anything beyond the most simple shell scripts. (If only the inventor of PowerShell had spent ten minutes outside the Microsoft ecosystem before locking himself in a seafoam green office for two years...)<p>Doesn't solve the IT admin scenarios PowerShell is good for but I don't go there. And if I did, I'd use C# anyway. No need to learn a new language to loop and call objects, that's solved.<p>With the .NET Core stuff, I'm using C# and Microsoft.DotNet.Cli.Utils and the end result is briefer and saner than Python argparse, and file operations work great cross platform. Less issues than even Python, plus I can use LINQ to sort and remove dupes. Handy.<p>As for the "Windows command line" (cmd.exe) well, it still sucks. Console2 plus Clink and ... well, you'll still miss zsh on cygwin or what just works out of box on Mac... but, hey, it's a start.
tl;dr: batch will steal your soul and sell your kids to the Great Old Ones' cultists. Bash is meh (the author doesn't really know much about bash). User Powershell. Save the world.<p>... and it's all true.