There is a syntax error in this line. There is no close paran on the $(ls... so there's no way this would have worked.