the tr at the end of the long aws cli line contained an unmatched '. The trick is, groovy seems to ignore the commenting out of lines in shell blocks, or requires a different comment character.