1 2 3 4 5 6
#!/bin/bash while read p; do read -a arr <<< $p passwd -d ${arr[0]} done <<< "$(passwd -Sa |egrep '^[^[:space:]]+[[:space:]]P[[:space:]]')"