Question : korn shell using grep

I have the following code. I need to loop through the list of clients. The results get appended to results.out for each client. Then I want to grep for the 3 processes Server1, Order1, Replicator in the results.out file. When any of the 3 processes are missing for any client I need to show the result in a file. I need the missing process and the client name in the file. Please advise.

for client in client728 client729 client730 client731 client732
do
echo `ssh jrc1qsapp05 "ptree $client"` >> results.out
cat results.out | grep [Server1|Order1|Replicator] > $client_report.out
done

Answer : korn shell using grep

ssh jrc1qsapp05 "ptree $client > results.temp.$$
for process in Server1 Order1 Replicator
do  
   grep -q $process results.temp.$$ || echo $client $process missing >> $client_report.out
done
rm results.temp.$$
Random Solutions  
 
programming4us programming4us