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

Re: service helper package



On Mon, Nov 26, 2007 at 04:51:38PM -0800, C.J. Adams-Collier wrote:
> On Mon, 2007-11-26 at 12:32 +0000, Jörg Sommer wrote:
> > C.J. Adams-Collier <cjcollier@gmail.com> wrote:

> > > # Fully qualified paths to required programs
> > > START_STOP_DAEMON=/sbin/start-stop-daemon
> > > CAT=/bin/cat
> > > ECHO=/bin/echo
> > 
> > Why not use echo and cat? Calling echo this way the shell can't use the
> > builtin echo command and must spawn a new process.
> 
> Is there a test to determine whether there is a builtin for a given
> command?  If so, we could test for that and use it if it exists.
> Otherwise, use the fully qualified version
There's "type" and "command" and "which" and "whatis" (see the policy
huge long bug about this things) but I don't know why you would use
them at runtime (except I guess how debhelper does it with
if [ "`which ... 2>/null`" ]; ...)

Justin



Reply to: