Live data from Hacker News

A Saner Windows Command Line

futurice.com

61–70 of 164 posts

Re: A Saner Windows Command Line

#61
post #40
post #9

Earlier quoted context omitted.

Bash can be _extremely_ cryptic as well, we just learned it over time. Look at awk :)

Why use bash when you can use Python with os and sys modules?

I prefer Python when appropriate, but if you're going to "shell out" a lot and pipe a bunch of commands together it starts getting too verbose and loses it's elegance. I agree with other posters that bash is not intuitive, but if you've worked with it for a long time, there's nothing like being able to cat | grep | sed in a one-liner, rather than creating a bunch of Process objects, etc.

Re: A Saner Windows Command Line

#62
post #21

Why would you even want to make Windows command line better, instead of using a state of the art command line of Linux via a VM running in Windows, if you really cannot escape the Windows realm ?

Because not everyone shares your opinions. I'm not a fan of Powershell, but one thing I love about the design is that it works on objects, not text. UNIX philosphy relies heavily on text and it keeps some things simple, but when you need to move beyond that to more complex structure, the UNIX command-line starts breaking down, whereas Powershell pipes, etc. continue to do well. There are good ideas out there beyond "just use Linux."

Re: A Saner Windows Command Line

#63
post #21

Why would you even want to make Windows command line better, instead of using a state of the art command line of Linux via a VM running in Windows, if you really cannot escape the Windows realm ?

If the Linux command line is state of the art, then the art hasn't advanced that far. Too much of it is frozen in time, with constraints from PDP-11s with two-tone 80-char displays, and insane, arcane UI that made sense to the wizards of that day, but less so to we mere mortals. Lots of inertia there.

Still CMD is worse, and Powershell is different, but maybe not any better...

Re: A Saner Windows Command Line

#64
post #11

Powershell and its long winded cmdlets are really hard for me to like. I always fall back to cygwin on windows. I once wrote a PS script to set some power management options on a corporate laptop. The script was 11 lines long (vs 3 lines in Python), it was harder to read and understand. Even with ISE available it was much harder to write. I followed along with some exchange server tutorial where the prescribed easy w…

I made a big push at some point to start using Powershell instead of the horrible .bat files I had written at some point (and their arcane unreadable commands). But Powershell's syntax, convoluted names and the unreadable code we had to write to do simple things really made me reconsider seriously. I simply use Python for these things (99% time it has all I need).

I don't really understand this. If you don't like the verbose names of PowerShell commands, you still have the option to set up command aliases. Out of the box, PowerShell includes a number of common Unix terminal commands as aliases:

https://technet.microsoft.com/en-us/library/dd347739.aspx

Re: A Saner Windows Command Line

#65
post #11

Earlier quoted context omitted.

I made a big push at some point to start using Powershell instead of the horrible .bat files I had written at some point (and their arcane unreadable commands). But Powershell's syntax, convoluted names and the unreadable code we had to write to do simple things really made me reconsider seriously. I simply use Python for these things (99% time it has all I need).

I don't really understand this. If you don't like the verbose names of PowerShell commands, you still have the option to set up command aliases. Out of the box, PowerShell includes a number of common Unix terminal commands as aliases: https://technet.microsoft.com/en-us/library/dd347739.aspx

Well right there, that's an extra step that I don't need to do when using Python. But I'll have a look at the link, thanks!

Re: A Saner Windows Command Line

#66

Powershell and its long winded cmdlets are really hard for me to like. I always fall back to cygwin on windows. I once wrote a PS script to set some power management options on a corporate laptop. The script was 11 lines long (vs 3 lines in Python), it was harder to read and understand. Even with ISE available it was much harder to write. I followed along with some exchange server tutorial where the prescribed easy w…

I guess the difference between bash scripting and powershell scripting is that you have to learn a lot of things upfront to be productive with Powershell. Bash, on the other hand, with its simpler syntax and collection of text based utilities you can get productive pretty quickly. If you want more power or if you want cleaner code you can always switch to Python et al. Thus, the learning curve is much more gentle. Th…

The first thing you should learn with PowerShell are the discoverability features: Tab completion, Get-help, get-command, show-command, get-member, get-alias. Last time I checked (and admittedly it's been a few years) bash has man pages and that's it.

Re: A Saner Windows Command Line

#67
> I know what you're probably thinking. One of the reasons you use Windows is so you don't have to use the command line.

I know what I'm thinking. One of the reasons I don't use Windows is that its command line is a second or third class citizen.

Re: A Saner Windows Command Line

#68
post #19

I tried both ConEmu (twice) and Console2 in the past, but both were too unstable for regular use. If someone can convince me that the situation has markedly improved, I might try again, but I guess I'll just wait until we upgrade to Windows 10 at my workplace (which they say is any day now).

I use ConEmu (actually cmder - ConEmu with some out-of-box enhancements) every day at work under Windows 7 Pro. Absolutely no issues to report.

Re: A Saner Windows Command Line

#69
post #26
post #19

I tried both ConEmu (twice) and Console2 in the past, but both were too unstable for regular use. If someone can convince me that the situation has markedly improved, I might try again, but I guess I'll just wait until we upgrade to Windows 10 at my workplace (which they say is any day now).

I have been using ConEmu since December and I am yet to run in issue. I use it with Gow and clink. What issues did you face?

Crashes of the console, usually happening after executing a few commands. This was a few years ago, probably on WinXP, but could be Win7 (I'm on Win8.1 now).

Re: A Saner Windows Command Line

#70
post #16
post #2

At our office we jokingly refer to powershell as "two googles per line" - a term coined by its strongest proponent at the company. It thought it would come naturally over time, but it never does. It seems needlessly cryptic and verbose in so many ways. I've started using LinqPad for stuff I would normally do in cmd now.

Learning Bash is just as cryptic. At least powershell function names have logic behind them.

I don't see anything illogical in fg bg ls cd mkdir cp rm man ... Perhaps a little cryptic, but it's just mnemonics. Not to mention that short names are very convenient in a text-based shell.
Post reply on HN