* Frank Terbeck <bts@bts.grml.org> [20090215 14:11]:
> Let's face it, I'm an idiot. :-)
> Missed one improvement I mentioned earlier (the '&& break').
> [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 && break
> done
> IFS="$oifs"
> unset oifs
> return "$ret"
> }
> [snap]
> [...]
> > So, I'm happy with this now.
> No, now I am. :)
Cool. thanks! Applied and pushed:
http://git.grml.org/?p=grml-scripts.git;a=commit;h=7760a19 Add ist_installed(), thanks ft! | 2009-02-15 16:51:19 +0100
regards,
-mika- |