By supplying the grep sequence as the value to be used by the for loop, the Bash script in this recipe is essentially just looping through the output from that function. By running that function independently, one can see that it just extracts a list of IP addresses that correspond to hosts running web services. The for loop then cycles through these IP addresses and runs a Nikto scan for each.