Prefer gawk over awk if both are available.
Import recent changes from ruby-build 20140420