Remove `local` from the shell script will allow to use it on Solaris, BSD and Linux with ksh or bash.