#!/bin/sh DEVICE="$1" TOTAL_DEVICES=$(mdadm -D "$DEVICE" | grep 'Total Devices' | cut -d':' -f 2 | tr -d ' ') mdadm -D "$DEVICE" | tail -n "$TOTAL_DEVICES" | tr -s ' ' | cut -d' ' -f 6 # Example Output: # # active # active # active # active # active # # Da https://linux.die.net/man/8/mdadm pare che gli output sensati siano "missing", "failed", "spare" ed "active".