getting a little closer, i was running the grep command directly from the PC [adb shell ls -l | grep text] and the error message was coming from DOS shell.
now just doing a shell into the MC40 [adb shell] and get the $ prompt. now I type [ls -l | grep text] and get the error: "grep, permission denied"
looks like i need to be root to run the grep command which seems strange since it is a user level shell command.
does anyone know if there is a way to run GREP on MC40?
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.