Posted by: Anonymous
[ip: 24.57.109.194]
on October 18, 2008 05:12 AM
To Anonymous [ip: 4.227.198.146]:
I'm not the person who complained about your (ab)use of locate. However, (s)he is completely right. You don't understand. Let's say you don't really have kexec installed. But a random/old/whatever copy of kexec just happens to be sitting in /opt/blah/kexec for no apparent reason. But /opt/blah/ isn't in your path. The locate command might find the file just fine. But when you actually go to RUN kexec, it'll fail because it's not in your path.
Locate might also yield false positives, such as /home/root/how_to_use_kexec.htm. It'd be kind of hard to run such a document as a command.
The which command, on the other hand, will ONLY check your path and will ONLY return executables with the right permissions. That's exactly what you want. If the which call succeeds, your kexec call should succeed as well (barring the various nasty problems you've already named).
Re(1): Reboot like a racecar with kexec
Posted by: Anonymous [ip: 24.57.109.194] on October 18, 2008 05:12 AMI'm not the person who complained about your (ab)use of locate. However, (s)he is completely right. You don't understand. Let's say you don't really have kexec installed. But a random/old/whatever copy of kexec just happens to be sitting in /opt/blah/kexec for no apparent reason. But /opt/blah/ isn't in your path. The locate command might find the file just fine. But when you actually go to RUN kexec, it'll fail because it's not in your path.
Locate might also yield false positives, such as /home/root/how_to_use_kexec.htm. It'd be kind of hard to run such a document as a command.
The which command, on the other hand, will ONLY check your path and will ONLY return executables with the right permissions. That's exactly what you want. If the which call succeeds, your kexec call should succeed as well (barring the various nasty problems you've already named).
#