make shell scripts more portable