Adjusted shell scripts for use with Apple OS X version of awk.