Added shell script looping to handle sed limit