3 ms·
No this doesn't really make sense. Unix shell is "situated in" a bunch of native executables (grep, awk, ripgrep, etc.) and textual data, while PowerShell is V
by chubot 3y ago
No this doesn't really make sense. Unix shell is "situated in" a bunch of native executables (grep, awk, ripgrep, etc.) and textual data, while PowerShell is VM-based, with bindings to Windows.
If I were doing stuff with Windows registries, I might use PowerShell, but I don't. I use Unix.
One is not a substitute for the other -- it's both the language AND the "bindings" that count. bash runs on Windows, and PowerShell runs on Linux, but you lose a lot of "enviroment" in both cases.
I wrote about this distinction here - https://www.oilshell.org/blog/2023/06/ysh-design.html https://www.oilshell.org/blog/2023/06/ysh-design.html - Oils Is Exterior-First (Code, Text, and Structured Data)
In those terms, I say PowerShell/nushell are "interior-first", while bash and OSH/YSH are "exterior-first". It makes a big difference when using them.
- forgotpwd16 3y agoBelieve GP meant it as (not necessarily end up using it due to lacking the environment as you said) "check pwsh to see how things can be if you think bash is good". Worth noting, since you mention that pwsh has bindings only to Windows, that it's possible to make Linux-specific cmdlets/bindings in fashion similar to your YSH if understood it correctly (that is layering an object environment atop the text i/o of Linux commands).
- joiewjfoi2 3y agoIn PowerShell, you can skip the need to master numerous DSLs for various data formats. Simply convert XML, JSON, YAML, etc., into objects and leverage built-in methods for manipulation. Bash, on the other hand, often requires you to familiarize yourself with tools like xmlstarlet and JQ, making the learning curve steeper. Additionally, PowerShell offers enhanced reliability since it primarily deals with structured data rather than raw text. Its consistency is also a notable advantage when compared to Bash, and the longer cmdlet names are offset by handy 2-3 letter abbreviations.
- Already__Taken 3y agoI'd like to add my issue with the specific DSL approach isn't the learning curve, but the curve is a saw tooth pattern. If you don't keep using those DSL's weekly, in 2 years I dare you to write a valid one from memory. pwsh reinforces pretty much the same* thing every time it's used, the more you learn the more you can do with every command, even ones you haven't used yet. same subject to some base-level provided by the module. i.e. the active directory cmdlets have their own dsl inside -filter because it is a different thing. It's very analogous to `a = sql.cmd('SELECT ...').map(etc...)`. you can, you shouldn't, but maybe its fine. It's up to you.