On Mon, 2009-06-01 at 10:34 -0600, Brian Phillips wrote: > I believe, though I don't have any proof to back me up, that it's considered > good practice to use the full path to the command in scripts, rather than > assume the environment will guide you to the correct binary. Instead of > "snmpget" try "/bin/snmpget" or whereever snmpget is installed on your > system. This may not fix your problem, but it will make a more robust > script.
It is not, in general, a best practice. Hard coding the path makes scripts harder to read and less portable. In most cases, it's just silly. Does it really matter if egrep is installed in /usr/bin or /opt/gnu/bin? No, it doesn't. What does matter is that your $PATH is set such that the command you want is the command you get. -- "XML is like violence: if it doesn't solve your problem, you aren't using enough of it." - Chris Maden -------------------- BYU Unix Users Group http://uug.byu.edu/ The opinions expressed in this message are the responsibility of their author. They are not endorsed by BYU, the BYU CS Department or BYU-UUG. ___________________________________________________________________ List Info (unsubscribe here): http://uug.byu.edu/mailman/listinfo/uug-list
