On Wed, Feb 11, 2009 at 6:21 PM, Karel Zak <[email protected]> wrote:
>
>  I know, that's nit-picking, but I cannot resist ;-)
>
> On Wed, Feb 11, 2009 at 03:41:56PM -0800, Victor Lowther wrote:
>> +find_binary() {
>> +    local binpath="/bin /sbin /usr/bin /usr/sbin" p
>> +    [[ ${1##*/} = $1 ]] || { echo $1; return 0; }
>> +    for p in $binpath; do
>> +     [[ -x $p/$1 ]] && { echo "$p/$1"; return 0; }
>> +    done
>> +    return 1
>> +}
>
> [...]
>
>> +    local src=$(find_binary "$1") || {
>
>   PATH="/bin:/sbin:/usr/bin:/usr/sbin"
>   local src=$(type -Pa "$1")

What will that do when passed an absolute path to a file that is not
an executable?

>    Karel
>
> --
>  Karel Zak  <[email protected]>
>
--
To unsubscribe from this list: send the line "unsubscribe initramfs" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to