News for hackers. Stuff that matters.
Re:Four features that justify a new Unix shell by asiachick on Friday October 23, 2020 @09:30PM (#24876163)
How about Powershell

https://github.com/PowerShell/PowerShell

I can't call myself a fan of powershell but if everyone switched I'd get used to it.

sh and bash both seem like they should die in a fire. They are full of foot guns that end up costing millions in breaches and lost data. The space think even bit Apple back in the day, they had some OS upgrade script that ended up deleting your entire hard drive if there was a space in the volume name.

Re:Four features that justify a new Unix shell by chubot on Saturday October 24, 2020 @12:22AM (#24876917)
sh and bash both seem like they should die in a fire. They are full of foot gun

Right, that is the point of Oil. The post describes 4 footguns that you can now avoid. Moreoever, you can run your existing shell scripts with Oil first, and gradually move away from the dangerous style.

Rewriting even 500 lines of shell in Python is not a pleasant task (even if you think Python is better for the task).

Re:Four features that justify a new Unix shell by ZeteticElench on Friday October 23, 2020 @10:47PM (#24876543)
PowerShell is pretty damn awesome once you get the hang of it. The way objects are passed via pipe allows for really cool things like get-foo | where {$_.bar -eq 1} and you can serialize the output of most commands with get-foo | convertto-json. I use this feature all the time. Get-ADObject | convertto-json will give you a dump of your entire AD.
Re:Four features that justify a new Unix shell by Kuinox on Friday October 23, 2020 @09:38PM (#24876200)
Powershell is a bit better, but got it's own disadvantage:

Despite the consistent naming, I can't remember correctly the modules names.

Running Remove-NetFireWallRule without arguments delete all the firewalls rules despite a flag "-All" not being set.

The learning curve is too hard, or it's too complex to learn on the job: It takes me at least half an hour to write semi-complex commands despite the number of hours I struggled trying to write commands with.

And it still suck as a scripting language.

Re:Four features that justify a new Unix shell by sedatk on Friday October 23, 2020 @09:59PM (#24876296)
> And it still suck as a scripting language.

Why do you think that? I find PowerShell quite neat and more consistent than what bash and alike has to offer.

Re:Four features that justify a new Unix shell by Kuinox on Saturday October 24, 2020 @07:42AM (#24878563)
It does "resume on error" by default.

It got script languages issues: The last line of your huge script may be syntaxically invalid. Here you start thinking "why I didn't wrote it in my favorite statically compiled language"

Yes, it's still more consistent than what bash and alike has to offer, but it's still behind if you compare it to any language that you can write to a file.

The only advantage it got against them, it's the huge API on windows.

Sadly I wanted to use Powershell functions from C#, tought it would be easy because Powershell use .NET Core, but it's far from easy.

Re:Four features that justify a new Unix shell by boston_sre87 on Friday October 23, 2020 @09:39PM (#24876202)
I usually avoid scripting in bash or sh and use python instead on the linux side. But yea, powershell is a pretty solid shell and seems more intuitive than bash/sh. The object oriented part is pretty awesome and lets you introspect objects easily so you know what kind of properties and methods are available.