Bug#747320: Mandate "type" in /bin/sh
On Wed, May 07, 2014 at 02:32:39PM +0100, Ian Jackson wrote:
> Package: debian-policy
> Version: 3.9.5.0
>
> I came across this in /etc/init.d/exim4:
>
> OLDIFS="$IFS"
> IFS=:
> for p in $PATH; do
> if [ -x "$p/$UPEX4CONF" ]; then
> IFS="$OLDIFS"
> $p/$UPEX4CONF $UPEX4OPTS
> return 0
> fi
> done
> IFS="$OLDIFS"
>
> I imagine that this kind of thing is found in many other places.
>
> It seems to me that given that dash and bash both provide `type', and
> the underlying functionality necessarily exists in the shell, it would
> be better to mandate that the shell expose it.
>
> I therefore propose that the following should be added to the list of
> additional features listed in policy 10.4:
>
> * The XSI extension `type' must be supported . It must exit
> zero iff the command is found. The output format is not
> specified and scripts must not rely on it; scripts should
> rely only on the exit code using a construct such as
> if type foo >/dev/null 2>&1; then ...
Could you do a survey of current valid /bin/sh shells and see which of them
suport XSI type already ?
Cheers,
--
Bill. <ballombe@debian.org>
Imagine a large red swirl here.
Reply to: