For some mysterious reason, whenever I run grep from a “standalone” shell script as opposed to a simple function, the coloring of the output is not preserved.
Why is this happening and how can I prevent it?
This is best illustrated with an example:

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You should try in your script :
But please, no need to
just
or
See http://porkmail.org/era/unix/award.html
EDIT
To change the defautl colors of grep, see
man grepand searchGREP_COLORS