On Mon, 09 Sep 2013 07:24:37 -0700 Tom Eastep <[email protected]> wrote:
> On 09/09/2013 07:12 AM, Martin Gignac wrote: > >> I must admit, that I don't know the 'qt mywhich' combo. But may I > >> ask why you don't use 'hash'? > > > > mywhich() is a function in lib.common which (I guess) emulates the > > behavior of 'which', and qt() is another function which send the > > STDOUT and STDERR of a command to /dev/null. There are many > > instances of 'qt mywhich' being used in lib.cli when there is a > > check for the existence of an executable. > > > > I was initially going to use 'command -v foo >/dev/null 2>&1' as > > suggested by this page: > > > > http://stackoverflow.com/questions/592620/check-if-a-program-exists-from-a-bash-script > > > > but then decided to use 'qt mywhich' instead since I'd seen it used > > many times already in 'lib.cli'. > > > > The most popular answer in the Stack Overflow link above suggests > > that using 'command -v' is POSIX compliant and would give more > > consistent results than 'hash'. > > The 'qt mywhich' paradigm dates back 15 years to when I first wrote > Seawall (predecessor to Shorewall). As Martin says, 'mywhich' emulates > 'which'. > > -Tom Might I suggest changing order of the commands in patch - we should always default to using ip command and only fallback to legacy arp etc.. -- Tuomo Soini <[email protected]> Foobar Linux services +358 40 5240030 Foobar Oy <http://foobar.fi/>
signature.asc
Description: PGP signature
------------------------------------------------------------------------------ LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99! 1,500+ hours of tutorials including VisualStudio 2012, Windows 8, SharePoint 2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack includes Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/20/13. http://pubads.g.doubleclick.net/gampad/clk?id=58041151&iu=/4140/ostg.clktrk
_______________________________________________ Shorewall-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/shorewall-devel
