4 ms·
You can also just use PowerShell. Its chief crime is its verbosity in naming, but it has the "universally available consistent structured output for the CLI" yo
by munchbunny 7y ago
You can also just use PowerShell. Its chief crime is its verbosity in naming, but it has the "universally available consistent structured output for the CLI" you're asking for.
- pitaj 7y agoNaw its chief crime is not having `&&`
- samstave 7y agoIm speaking from a position of naivete, so dont attack me; Would an ideal situation be “do + while” Whereas one may write While x is true do “blah blah” && if output is still true then end elif do &&? Or is that basically how it already works and we just have shitty interactions with the machines to get them too do the above (unless youre a more seniorbash person ((its one of my career regrets that i didnt spend a ton of time bash scripting)))
- pitaj 7y agoThere are ways around it but nothing as easy as `&&` in other shells
- nailer 7y agopwsh 7 is adding it
- travbrack 7y agoIs it actually useful outside Windows? I know the latest version is now portable because of .net core, but I haven't tried it on *nix.
- felixfbecker 7y agoYeah I'm using it as my primary shell on macOS. You can do everything you do with bash, but with objects, autocompletion etc
- addicted 7y agoI spent a lot of time in Powershell on Windows. Almost 3-4 years. I simply could not use it as a shell. I enjoyed converting our many build scripts into Powershell, but using it as a shell was just uncomfortable. It's not clear to me why. If I had to guess, besides the verbosity, it was the additional "indirection". Nothing was what it appeared on the screen. It was something else. Bash felt far more comfortable as a daily shell because what you see is what you get. I want to try Nu because it appears to combine that WYSIWYG simplicity of bash with the Powershell quality of passing data rather than text. Maybe tables are indeed a better data structure to use than objects.
- munchbunny 7y agoPowerShell is more like interactive Python with very smart tab completion than "bash with objects." Basic conveniences like "grep" require some memorized scripting gymnastics because the commands got generalized a little too much. For regular shell usage it's a bit painful because the abstractions are a bit too far removed from the file system you're operating on. But for scripting, such as managing and configuring systems, it's remarkably fluid. The "nothing is as it appears" problem never bothered me much because it's still just data. You just specify the output when you're done crunching it. IMO being able to operate with typed data is really nice because you don't have to worry (nearly as much) about serialization between commands.
- hyperpallium 7y ago(Disclaimer: never used powershell, so unadulterated opinion here) Scripting is programming, so you want data structures. For interaction, you want human-readable syntax. e.g. programming languages mostly have a syntax: C, python, bash, fortran (exception: lisp), but they operate on data structures. We can see powershell, nushell and other structured shells (e.g. some use XML) as an attempt to "get out of the syntax business", which XML began and JSON finished (https://blog.mlab.com/2011/03/why-is-json-so-popular-developers-want-out-of-the-syntax-business/ https://blog.mlab.com/2011/03/why-is-json-so-popular-develop...). This has been taken further into human read/write domains... with mixed reception: ant, XSLT, json as a config format. After all, parsing and "the syntax business" has a practical purpose.
- jen20 7y agoThe chief crime of PowerShell is actually how long it takes for a prompt to appear after starting it - especially on Windows. I still use it as a login shell on MacOS because it offers useful features, but it's (to put it bluntly) slow as hell to start.