in reply to Standard inpute must be tty

You make no effort to phrase your question in a way that anyone can really answer you (not even spell-checking your title). So why o why should I or anyone else make any effort to answer you?

Post a small example of your code that produces this error and add any explanation you feel is needed to explain your problem.

also read How do I post a question effectively?

grep
One dead unjugged rabbit fish later...