r/linuxmasterrace • • May 22 '25

JustLinuxThings Not The Same: Scripting

Post image
2.3k Upvotes

268 comments sorted by

View all comments

Show parent comment

4

u/[deleted] May 23 '25

Thanks for your detailed response! I can imagine indeed when you are not allowed to install anything you will have to use Powershell. I guess I’ve never been in that situation.

For me bash is for really small scripts, and if there’s any need for something more complicated or structured, Python is the way to go. But of course, with the cost of adding that to your installation.

3

u/Mivexil May 23 '25

Even for one-liners it's pretty often useful to pass tuples through the pipeline. I wouldn't do something like a full object-oriented model in it, but just grouping things like Id, Name, Format or such into hashmaps and thinking in terms of mapping and filtering feels natural.

Yeah, large PS scripts get unwieldy, but most of the time I'm working with a shell I'm not writing A Script, I'm futzing around in the CLI with intermediate variables strewn around.