There is no doubt that you love your child. This is certainly true, even if you still feel anger, resentment or bitterness towards his/her mother or father. Sometimes when your child acts or behaves like your ex-spouse, it may be hard to not react angrily and say " you are just like your father/mother". Ordinarily, this is not said in a loving tone.
It is important to fight your initial desire to make this statement. Your child is an individual. This does not mean he/she may not do things or speak in a way similar to your ex-spouse. The key is to separate the person from the behavior that triggers bad memories about your ex-spouse.
There are numerous reasons making such a statement is damaging. First, it does nothing to deter the behavior that you want stopped. Second, your child still loves his/her parent and you are demeaning the person they love. Doing this could also backfire on you, as your child may resent you one day.
For example if you ask your child to take out the garbage and when you asked your ex-spouse to do it, he said "Do it yourself, I'm busy", and now your child is saying this, you must fight the urge to make the "just like your father" statement.
Instead, focus on addressing the behavior. A better response would be to advise that the above response is disrespectful and not acceptable. You may want to encourage a response from your child such as "I am just finishing something, can I do it in a minute?" It should be stated in a respectful tone to an adult. It is then important that the child follow through and complete the task.
If you make the "just like your father/mother" statement, it would be a good idea to cool down and apologize to your child. Let them know that you said something you should not have said and that you are sorry. Then address the behavior and any necessary disciplinary consequences such as taking away their iPod or Xbox.
Your child(ren) will have more respect for you when you acknowledge your mistake and it will let them know you are also human.
The most important advise is to control your emotions and take deep breaths. Of course there is always my favorite, an adult time out.