Get the output of for loop and use it in another loop BASH

Hi All,

I’m trying to capture the output of for loop and use that as source in the while loop in Bash. I’ve been trying like hell on this. but could not crack it. Can any one help me on this issue.

Thanks in advance