#!/bin/bash while read -a line; do for word in ${line[@]}; do [[ $word == "The" ]] \ || [[ $word == "Foundation" ]] \ || [[ $word == "Project" ]] \ && continue grep $word gone_orgs.txt done done \ < returning_orgs.txt