make this script work on solaris