Updating shell script to work in OSX