Changed two grep calls to 1 call to sed