

Also your implementation has a bug because dirname blah.png returns “.” 😉
It wasn’t meant as a 1-1 implementation, but fair enough.
I would argue that this helps my point. Because that’s an ambiguity dirname doesn’t help with. What if “bla.png” is, or expected to be, a dir?
And if you’re going to test, are you going to use shell bult-ins or the test command from coreutils? And if you’re calling test, are you calling it with the full path so you don’t get a shell builtin anyway or not?
If I was just going to use the built-ins I’d use Python or Ruby or something.
Using a better language is absolutely the right thing to do for anything that is not trivial.
Python is a shit choice for another reason though. They don’t know what backward compatibility means. So you may find your script broken in 2-3 years anyway. I don’t know about Ruby.

Parent mentioned that the supposed bug was already fixed, that’s not the point.
And they target GNU compliance, not POSIX compliance. Which is hard mode, since if it was the latter, they could have just checked out the freebsd utils or whatever at will whenever they felt unsure about something.