Most Android devices use a Busybox replacement called Toolbox for all of the normal command line tools. I presume the MC40 also uses Toolbox. Try grep --version and see what it says. It might be that grep does not have correct permissions (it needs execute permissions). On my Samsung phone, here is what the permissions look like:

1|shell@android:/ $ ls -l -a /system/bin/grep

lrwxrwxrwx root root 2013-03-10 17:43 grep -> toolbox

Edit: Also consider taking a look at this "Android under the hood" article.