4 ms·
> Then there's the convention used to override shell built-ins by calling the full path to the non-built-in version. If the full path is used and the built-in h
by sjs 15y ago
> Then there's the convention used to override shell built-ins by calling the full path to the non-built-in version. If the full path is used and the built-in has been relocated, that's going to break, too.
I don't understand this part. If you specify any path then you will not be running a shell built-in. Relocating a built-in makes absolutely no sense since built-ins have no path. That's what makes them built-in.
- viraptor 15y agoThere are some built-ins which also have a corresponding command. For example "true" is a built-in in bash, but there's also "/bin/true". So some people might prefer to use /bin/true for whatever reason. I believe this is what that quoted fragment referred to.
- scott_s 15y agoCorrect, but his point was that the sentence says built-ins can be relocated, which makes no sense.
- viraptor 15y agoI think it was just a mistake, or a mental shortcut for: "If the full path is used and the [binary or script reimplementing said] built-in has been relocated"
- scott_s 15y agoBuilt-ins don't call a separate binary or script - they are literally implemented as a part of the shell. That is, if you look at the shell source code, you will see functions that implement the built-ins. As I pointed out elsewhere, I think they mistakenly said "built-ins."
- scott_s 15y agoYou're right, I assume they meant to say "If the full path is used and the program that was meant to be called has been relocated, that's going to break, too."
- JoshTriplett 15y agoThey plan to symlink /bin -> usr/bin, sbin -> /usr/sbin, and possibly /usr/sbin -> bin, to preserve compatibility with absolute paths. Those symlinks will almost certainly stick around forever.