Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 25 Jan 2006 11:31:52 -0500 (EST)
From:      Ensel Sharon <user@dhp.com>
To:        Luke Bakken <luke.bakken@gmail.com>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: shell scripting question (mdconfig device choosing)
Message-ID:  <Pine.LNX.4.21.0601251131290.8684-100000@shell.dhp.com>
In-Reply-To: <6acc6ca40601250827l34ed2a08jaf160b94443bff0d@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help


On Wed, 25 Jan 2006, Luke Bakken wrote:

> #!/bin/sh
> 
> function find_first_mdevice
> {
>     MDDEV='md0 md1 md2 md3 md4 md5 md6 md7 md8 md9'
>     MDOUT=`mdconfig -l`
> 
>     for DEV in $MDDEV
>     do
>         if ! echo $MDOUT | grep -q $DEV
>         then
>             break
>         fi
>     done
>     echo $DEV
> }
> 
> find_first_mdevice


Thank you so much - I will try it out immediatelty.




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.LNX.4.21.0601251131290.8684-100000>