Remix.run Logo
eternityforest 6 days ago

What can you do with bash that isn't in the stdlib of python?

Generally the only nontrivial scripting I ever do is associated with a larger project, so I often already have a pyproject.toml and a UV environment, and I just add the dependencies to the dev group.

mubou2 6 days ago | parent [-]

Well, that's kind of what I mean. For scripts in a python project, you can freely use whatever packages you need. But for one-off scripts, if you need bs4 or something, you're screwed. Either your script now has external dependencies or it requires special tooling.

It just feels strange that C# of all languages is now a better scripting tool than Python, at least out of the box. I did notice uv has exactly the feature I'm looking for, though it's obviously third-party:

https://docs.astral.sh/uv/guides/scripts/#declaring-script-d...

Is everyone just using uv now instead of pip, perhaps? Or is just another alongside pipenv, conda, poetry, etc.? (Python's not my main these days, so I'm out of the loop.)

jollyllama 2 days ago | parent | next [-]

I don't understand. To return to GP's point, what can you do in bash that you can't do in Python? Said in another way, what does bash offer that you would need to tackle with a dependency in Python? My understanding is that there is no such thing, and accordingly, you can still end up with something that is better than bash if you just use Python and call out to other tools with subprocess.

dizhn 2 days ago | parent [-]

There's bash. Then you need better loops/conditionals and more usable structures. That's when one should think of using a scripting language instead. I think the parent goes too far after that and what he's talking about is not something bash can do (well).

That said, a lot of very complicated things are actually written in bash. Distrobox I think is for example.

DonHopkins a day ago | parent [-]

>That said, a lot of very complicated things are actually written in bash. Distrobox I think is for example.

They're only complicated BECAUSE they're written in bash. If they were written in Python they would be much less complicated, more modular, able to use many existing industrial strength well tested python modules instead of rolling their own ad-hoc ones, and much easier to maintain.

eternityforest 5 days ago | parent | prev [-]

UV is taking over really fast, it seems to be much more popular any other option.

I suspect conda still has some market share too but I've never needed it.

psunavy03 2 days ago | parent [-]

It's amazing what happens when something just works.