Why is the script being sourced? Just because it is interpreted (starts with a #!) doesn't mean it is sh or bash. Unless there is a need to do so just switch to executing it by removing the dot.