for($i=0;$i<100;++$i){ $node[$i]=`grep -r "exceed" /ver1/ver2/ver3/node* | awk '{printf(\$3);printf(\$4)}` | tr '\|' ' ' | awk '{printf(\$2)}'`; }