4 ms·
It's sort of staggering if you consider how inefficient Unix has been, where every shell script involves several dozen $PATH-based invocations. If you call a gi
by NoZebra120vClip 3y ago
It's sort of staggering if you consider how inefficient Unix has been, where every shell script involves several dozen $PATH-based invocations. If you call a given program, say 20 times in a script, and it's located at the third element in $PATH, then that's 40 failed calls to execve(2) that could've been avoided by some sort of caching.
- sgbeal 3y ago> located at the third element in $PATH, then that's 40 failed calls to execve(2) that could've been avoided by some sort of caching. Bash caches path lookups and has a command to clear them (i forget its name and am on a tablet, so can't readily check... Maybe "hash" or "rehash"?).
- lifthrasiir 3y agoYes, `hash -r`. You can also use `shopt -s checkhash` to automate this.