make the script work on Solaris