3 ms·
It's an interesting question. In most shell, it is possible to "source" a given file, which basically is a form of file inclusion. How should the script locatio
by WildcardWiz 5y ago
It's an interesting question. In most shell, it is possible to "source" a given file, which basically is a form of file inclusion. How should the script location feature behave in that situation? Should it report the sourced file location, or the sourcing one?
In the later case, does it mean that it is not possible to write reusable code based on that feature? In the former case, what should be done when sourcing is done recursively? Can this be used to defeat file location, for instance, by generating a script in /tmp and sourcing another file from it?