aws-env rewriting script