On Fri, 6 Sep 2024, Jacob Bachmeyer wrote: > > By the way, I need another patch, as /bin is not existing in my case. I'm > > actually a bit wondering why all tools like awk, expect, tcl have a fallback > > without a path just to their executable name, but sh needs a fallback to > > /bin/sh. But anyway, this is a common problem packaging software for Guix > > and not a problem of DejaGnu. > > That is because most tools can be in varying places, but there is a > long-established *nix convention that the system shell is exactly "/bin/sh" > and that shell is a Bourne shell of some type. The scripts in DejaGnu that > expect to use it are accordingly written to run within the restrictions of > even ancient Bourne shells, which is one of the reasons that dejagnu(1) does > not itself search the PATH, instead relying on the shell running it to do so > when needed. > > There is a technical reason for this assumption about /bin/sh: the #! > mechanism does not search $PATH and requires an absolute filename. > > In fact, how are you even running the dejagnu(1) and runtest(1) scripts if > /bin/sh does not exist? Their #! lines refer to /bin/sh...
POSIX says otherwise, you must not rely on the presence of /bin/sh; cf. <https://pubs.opengroup.org/onlinepubs/9799919799/utilities/sh.html#tag_20_110_16>. The path to the interpreter can be easily substituted e.g. with autoconf. Maciej