[issue431] wm-ng on grml-medium 0.1

Frank Terbeck bts at bts.grml.org
Sat Feb 14 22:43:23 CET 2009


Frank Terbeck <ft at grml.org> added the comment:

Frank Terbeck <ft at bewatermyfriend.org>:
> is_installed() {
>     prog="$1"
> 
>     ret=1
>     oifs="$IFS"
>     IFS=:
>     for dir in $PATH; do
>         [ -x "${dir:-.}/$1" ] && ret=0

Thinking more about it, this is probably better done like this:

    
        [ -x "${dir:-/bin}/$1" ] && ret=0

Why? Well, /bin is probably in everybody's $PATH and using '.' would
sneak . into $PATH (well, not really but for the test if $PATH is
something like PATH=/bin:/sbin::/usr/bin) which is something *nobody*
wants.

>     done
> 
>     IFS="$oifs"
>     return "$ret"
> }

Regards, Frank

----------
assignedto: mika
messages: 1244, 1245, 1876, 1877, 1881, 1883, 1884, 1887, 1888
nosy: ft, maddi, mika
priority: bug
status: in-progress
title: wm-ng on grml-medium 0.1
topic: release-stopper

_____________________________________
GRML issue tracker <bts at bts.grml.org>
<http://bts.grml.org/grml/issue431>
_____________________________________


More information about the Bugs-changes mailing list