update scripts to handle differences between Darwin and Linux coreutils