Truncated with a pipe?

OK, I'm stumped.

I have a shell script that reads a list, and for every item in the list performs a lookup in our Active Directory. Now, it seems that when I pipe the results into grep, the complete results are not there (truncated?). I'm not sure if this is a limit of the pipe, grep, shell script or what. The thing is, when I just echo the command into a file, all the info is there, but when I echo into a file after a pipe, it's not.

This poses an issue because from the pipe, I need to grep for something. The problem is, the something is not there. If I run the same exact command from the command line, it works. It seems that when running the command from a shell script, it can only handle a certain size result??

Running OS X 10.4.3

Thanks for any help!

try putting an intermidiate 'cat' before your 'grep':

myScript | cat | grep

It might be a case of 'buffering'. Having a 'cat' [no pun intended] acts as a 'valve' flushing the complete output of 'myScript' into the pipped 'grep'.