Made script more portable across *nix platforms.