[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[ale] A bash question



On Wed, 2009-09-16 at 18:06 -0400, Chuck Payne wrote:
> I am looking for best practise. Thanks.

Rely on $PATH.  Seriously.

The system administrator will have iptables where they want it.  Some
systems are smart enough to give /usr/local/* precedence over the system
package-manager-managed stuff, and systems that aren't, admins will
probably have them set up that way in their own PATH variables.

So, let the system resolve the path for you; someone mentioned using the
'which' command, which searches the $PATH variable for you.  If you want
to store its output locally, do something like:

IPT=$(which iptables)

And if IPT is empty, you can signal an error stating that iptables is
required.

	--- Mike

-- 
Blog:  http://mike.trausch.us/blog/
Misc. Software:  http://mike.trausch.us/software/