Hacker News new | ask | show | jobs
by skywhopper 2262 days ago
This is a pretty poor comparison of the two, especially once it gets into the syntax, of which most of the Bash examples are broken in some way.

There’s also a lot of just straight errors, such as mentioning “true” and “false” “values” in Bash, which don’t exist—the userland toolset includes “true” and “false” programs that can be used to inject desired exit code status into some logic flow, but there is no real concept of a Boolean type.

Overall, if you’re going to provide a rundown of how x and y compare, you should probably give real examples, not just a laundry list of “instead of grep, we use select-string; instead of sed we use -replace”. But how do you use them? I worked with Powershell some over a decade ago, but this article doesn’t give enough info for me to understand what to do with the information it’s providing. And given the errors in describing how Bash works, I’m skeptical that the Powershell examples are syntactically correct either.

2 comments

To be pedantic: true and false are shell builtins in Bash and most other modern *nix shells. They are commands in the POSIX spec, though.
Agree.

I have just seen scroll size and imediatelly closed it.