On 29.11.13 0934 (+0400), Vladimir Skubriev wrote:
> check_rebuild_status(){
>         if [ $(grep "recovery" /proc/mdstat -c) -ne 0  ]; then
>                 return 0
>         else
>                 return 1
>         fi
> }
> 
> Чтобы было более элегантно.

check_rebuild_status(){
    grep -q recovery /proc/mdstat
    return $?
}

-q, --quiet, --silent
Quiet; do not write anything to standard output. Exit immediately with
zero status if any match is found, even if an error was detected.  Also
see the -s or --no-messages option. (-q is specified by POSIX.)


-- 
To UNSUBSCRIBE, email to debian-russian-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/20131129055001.ga7...@roadwarrior.8p8c.net

Ответить