should have compile-time options to disable mksh builtins
Bug #1616693 reported by
Elliott Hughes
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
mksh |
Invalid
|
Undecided
|
Unassigned |
Bug Description
builtins such as cat, echo, kill, pwd, realpath, ulimit, and sleep often have better implementations available on the platform.
some builtins (printf, say) do have compile-time options to disable them, but the ones listed above don't. it would be nice to have an "official" way to disable these rather than maintain a local patch.
To post a comment you must log in.
There is no “printf” builtin in mksh. It can be added as a speed hack, but this is discouraged, and the user has to provide the code (printf.c) themselves, although it can be taken from MirBSD.
Similarily, making “echo” external will slow down things. (Do note that mksh has no less than three “echo” implementations and, when called as “mksh” (not in sh or posix mode), offers the best one.)
“better” is relative. But let’s not argue this particular point.
I fail to see how you can make “killÌ” or “sleep” better… mksh’s offers 100% of the functionality commonly found (including sub-second sleep).
“pwd” and “ulimit” must be builtins.
We already defer to external utilities for both “cat” and (new in R53) “realpath” if called with an option, any option. (The “cat” builtin does, however, support the POSIX ‘-u’ flag.)
Please see the dot.mkshrc file shipped with the distribution for an implementation of the “enable” utility from GNU bash, which can be used to enable/disable using the built-in utilities or external ones. (The builtin is still available via “\builtin cat”, etc.) but take my advice to be careful with this — users don’t normally need, nor do, this.
After all, one of the strengths of mksh is that it behaves consistent across platforms.