Yes, those are all problems with bash and the state of the art.
The funny thing is that there about a dozen ways to spell it, like $(dirname $(readlink -f $0)). Since the shell itself doesn't provide this functionality, people come up with a lot of workarounds.
In Oil it will simply by $_this_dir, e.g. "source $_this_dir/mylib.sh" for relative imports. (Whenever a variable is silently mutated by the interpreter, akin to $?, Oil prefixes it with _).
https://github.com/oilshell/oil/issues/587
I solicit feedback on every Oil release: http://www.oilshell.org/blog/tags.html?tag=oil-release#oil-r...
so let me know what you think of the fixes: https://github.com/oilshell/oil/wiki/Where-To-Send-Feedback
Dealing with filenames is fixed in Oil: http://www.oilshell.org/blog/2021/04/simple-word-eval.html and with QSN:
http://www.oilshell.org/blog/2020/10/osh-features.html#safe-...
Again, if you don't think this actually solves the problem, leave some feedback. Oil is the most bash-compatible shell by a mile, so you might need to use it someday :)
(The theory is that in MOST situations you don't get to choose your language, just like you didn't choose C, C++, or shell. It's all the inertia of compatibility.)
Oil has named parameters: http://www.oilshell.org/release/latest/doc/idioms.html#use-n...
I know about the long file list problem, but I don't think I've ever run into it, mainly because I use xargs, which batches up commands correctly. If there is some other situation where it comes up, I'm interested.
Insane combination of grep / awk / cut: Oil has eggex which compiles to ERE to help you write egrep and awk patterns: https://www.oilshell.org/release/0.8.11/doc/eggex.html
You get syntax errors when you write the pattern (at parse time), not when you run it.
Crucially, we don't "rewrite" grep and awk. We just make them easier to use (optionally). There is a smooth upgrade path and you can retain your knowledge while forgetting about some sharp edges.
> Personally I find it amazing that people invented this thing, then spent decades tripping on the same quoting and filename handling issues and not finding that to be a good reason to fix it.
Yes I quoted David Korn complaining about the quoting problem in the early 90's, which was closer to Unix's invention than we are to the early 90's.
https://www.oilshell.org/blog/2019/01/18.html#slogans-to-exp...
The reason we still have it is the inertia of compatibility, and the fact that nobody really owns shell. Even though people rightly complain about Google's web stewardship, HTML5 was a great improvement and cleanup. They paid people to fix HTML, and it worked to a large extent.
Some food for thought: A Generation Lost in the Bazaar https://queue.acm.org/detail.cfm?id=2349257