If i type \"composer\" i get the above error message.
I did on my macbook:
curl -sS https://getcomposer.org/installer | php
sudo mv composer.phar /us
I get into the same issue even after moving the composer.phar to '/usr/local/bin/composer' using the following command in amazon linux.
mv composer.phar /usr/local/bin/composer
I used the following command to create a alias for the composer file. So now its running globally.
alias composer='/usr/local/bin/composer'
I don't know whether this will work in OS-X. But when i search with this issue i get this link. So I'm just posting here. Hope this will help someone.