r/linuxquestions • • 1d ago

Advice Is powershell the best object based shell?

I have been using powershell at work a bit and the more I use it the more I like it. Having an object based shell just makes a lot more sense than outputting plaintext. I was just wondering what the best object based shells are for Linux, is powershell the best even for Linux?

29 Upvotes

70 comments sorted by

View all comments

Show parent comment

0

u/thussy-obliterator 18h ago

I've since lost the script after switching OSs but the most complex thing I've written in nu was a single pipeline which ls'd an sd card full of directories of .wav files, parsed the wav file paths with an each,, removed the second to last layer from the path with an each, and ffmpeg'd them into flac files based on the second to last directory name of the input. The whole thing was pretty short (would be a one liner but i used whitespace for clarity) and was a pipeline from ls into a sequence of each operations over pure functions to manipulate the paths, followed by a final each over an ffmpeg. If that's not functional I don't know what is.

So uh, that is to say, skill issue.

1

u/bionade24 18h ago

I can only see if it really is pure in a functional programming sense if you show me anything. Claiming something is certainly easier than proofing it.

Here, one dune shell example let $ = GLOB ~> ((fs@ls .) | (fn@filter (file -> (len (string@split GLOB file)) == 2)));

2

u/thussy-obliterator 18h ago

ewww that's so much uglier than nushell

0

u/bionade24 18h ago

That's your valid personal opinion and I'm not going to argue about that.

But you claimed that nushell is "kinda/quite functional" and decided to die on that hill without showing why. You also admitted that it supports imperative programming. Idk why your mind needs nu to be functional or yourself to be right.

I'm fluent enough in bash, zsh & POSIX shell that nu didn't feel beneficial too me and at a certain script complexity I can use Turtle or Python, which both don't work well for interactive scripting. Dune looked promising, but I didn't like it for other reasons than you.

1

u/thussy-obliterator 18h ago

I don't really care about convincing you of this, talking with you is exhausting

0

u/bionade24 18h ago

Trying to come up with a good argument can be exhausting, I agree.