[issue431] wm-ng on grml-medium 0.1

Frank Terbeck bts at bts.grml.org
Sun Feb 15 13:51:28 CET 2009


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

Well, let me make a fresh start... :-)
I think this will make a final usable version.

[snip]
is_installed() {
    prog="$1"
    [ -z "$prog" ] && return 1

    ret=1
    oifs="$IFS"
    IFS=:
    for dir in $PATH; do
        [ -z "$dir" ] && continue
        [ -x "$dir/$prog" ] && ret=0
    done

    IFS="$oifs"
    unset oifs
    return "$ret"
}
[snap]

Works in posh, dash, bash ksh93 and mksh and in zsh's sh mode(at
least, I did test those). Cannot work in zsh mode, because $PATH
won't split without sh_word_split set.

Then again, in zsh mode, this would be done a *lot* differently.
So, I'm happy with this now.

Sometimes, sleep really helps. :)

Regards, Frank

----------
assignedto: mika
messages: 1244, 1245, 1876, 1877, 1881, 1883, 1884, 1887, 1888, 1889, 1892
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