This feeds a while loop with the output of a grep command:
while
grep
while IFS=":" read -r user _ do # "$user" holds the username in /etc/passwd done < <(grep "hello" /etc/passwd)