Updated sed replace to follow bash variable expanding