News for hackers. Stuff that matters.
Re:Filenames and Pathnames in Shell: How to Do It Correctly by Woeps on Tuesday June 20, 2023 @08:33AM (#36403101)
>"but never ever write a script for one. Use Python or Ruby or just about anything besides a shell."

And create a massive overhead because these python scripts just keep on breaking? No thanks, shell has its issues but saying not to use them anymore in simple scripts any to much of a hot take for me. (but please note this is a very biased take on my park)

Unless you're of course only want to use perl scripts... those things will keep on running for decades without ever breaking (or being readable)

Re:Filenames and Pathnames in Shell: How to Do It Correctly by viraptor on Tuesday June 20, 2023 @09:01AM (#36403352)
If you keep to basic functionality, there are very few breaking changes in both Python and Ruby. Apart from py2/3 and ruby string encoding change, I have not run into anything I remember now. I've experienced more issues with tiny differences between zsh/bash/ash/dash. (And Mac vs modern bash)
Re:Filenames and Pathnames in Shell: How to Do It Correctly by ElectricalUnion on Tuesday June 20, 2023 @09:28AM (#36403656)
Except the python3 str change was pretty big (and centered again, on those things that aren't just strings in POSIX).

Getting the correct `bytes` that went in your program uses completly different interfaces compared normal python use , for example, you now need to use `os.environb` instead of `os.environ` if you want to use arbitrary POSIX-compliant `bytes` environment variables and `argvb = [os.fsencode(a) for a in sys.argv]` instead of just `argv` for POSIX-compliant `bytes` command line arguments.

As people suggest in https://peps.python.org/pep-0383/ , handling really arbitrary inputs is tough work.

Re:Filenames and Pathnames in Shell: How to Do It Correctly by viraptor on Tuesday June 20, 2023 @09:33AM (#36403731)
Python 3 took about a decade to play out and for a few years you could opt to still explicitly use v2. Parent was saying those scripts "keep on breaking". Those two things are not the same.