Bug#218530: Suboptimal conditional rune for initscripts
Ian Jackson <ian@davenant.greenend.org.uk> wrote:
>
> This would be better expressed as
>
> if type -p invoke-rc.d >/dev/null 2>&1; then
> ...
>
> This latter form will detect accurately whether invoke-rc.d is
> available _on the current PATH_ as set by the sysadmin, and will
> therefore allow somewhat greater flexibility to admins (eg, to install
> invoke-rc.d separately in /usr/local before upgrading).
You'd better make that simply "type" so that it will work with
POSIX shells other than bash. Besides, there is no reason to
rule out aliases/functions/builtins since when invoke-rc.d is
actually run those things will all be considered by the shell.
Cheers,
--
Debian GNU/Linux 3.0 is out! ( http://www.debian.org/ )
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
Reply to: