replace perl with awk