I have seen the following line in a bash script for killing a process(in this case started with the command loadgen
):
ps xww | grep -i "loadgen" | grep "PATTERNMATCH_FACT.xml" | cut -c1-5 | xargs -i kill {} 2>/dev/null
I would like to understand the reason for piping after the two grep's in the command above.
The way the loadgen
command is started is the following. It's a part of the startup script.
./loadgen -XMLFile ${DEMODIR}/bam-103-pattern-match/data/PATTERNMATCH_FACT.xml -duration 0 -frequency 2