Working Shell script for mac try it on mac machine see if it works.