3 ms·
What about compiled binaries that for one reason or another is doing an execve() on "/usr/bin/cmp" or some such thing? Do you propose changing every script and
by blenderob 2y ago
What about compiled binaries that for one reason or another is doing an execve() on "/usr/bin/cmp" or some such thing? Do you propose changing every script and every binary on earth that expects Busybox to be a POSIXy, Unixy environment?
- pzmarzly 2y agoOn Unixes it doesn't matter if /usr/bin/cmp is a script or a compiled binary. If the script has correct shebang, kernel takes care of executing it.
- deleted 2y ago[deleted]
- oguz-ismail 2y agoShebangs are not part of the UNIX specification. What happens if an executable starts with `#!' is implementation-defined.
- immibis 2y agois being able to run busybox part of that specification? Linux ELF files are tagged for Linux OS, not generic Unix OS.
- blenderob 2y ago> is being able to run busybox part of that specification? It's the other way round. This is like asking if running RHEL is part of the specification? Obviously not. But RHEL provides an environment that is quite close to the specification. So is running a busybox part of the specification? Obviously not. But Busybox provides an environment that is close to the speficiation.
- immibis 2y agoThen it would be busybox's responsibility to make busybox work.
- account42 2y agoUNIX/POSIX doesn't specify an executable format at all
- sophacles 2y agoNo you make this script: #!/bin/sh exec /bin/busybox cmp And place it at /usr/bin/cmp
- teddyh 2y agoSurely you mean #!/bin/sh exec /bin/busybox cmp "$@"
- oguz-ismail 2y ago`#!/bin/sh' makes this less portable than it could be, if /bin/sh doesn't exists on my system it won't work, for example. Remove that line and it'll work everywhere.
- teddyh 2y agoIf /bin/sh does not exist, what in the world is executing the shell script?
- oguz-ismail 2y agoThe shell, of course. It just might not be (because it doesn't have to be) located in /bin.
- teddyh 2y agoI’m pretty sure that /bin/sh is mandated by POSIX.
- oguz-ismail 2y agoIt's not. See https://pubs.opengroup.org/onlinepubs/9799919799/utilities/sh.html#tag_20_110_16 https://pubs.opengroup.org/onlinepubs/9799919799/utilities/s... Applications should note that the standard PATH to the shell cannot be assumed to be either /bin/sh or /usr/bin/sh, and should be determined by interrogation of the PATH returned by getconf PATH, ensuring that the returned pathname is an absolute pathname and not a shell built-in.