scanvirus running two process

I need to be able to send a control-c signal to the scanvirus process (scanvirus calls clamscan).

kill -INT <pid> ;sends a SIGINT signal

However, I found two scanvirus running processes, but the code doesn’t call itself, no recursion.

#ps aux
root      3691  0.0  0.0  12868   760 pts/2    S+   09:57   0:00 /bin/bash /usr/bin/scanvirus -a u
root      4760  0.0  0.0  12868   252 pts/2    S+   10:00   0:01 /bin/bash /usr/bin/scanvirus -a u
root      5790  0.0  0.0   7432   916 pts/3    S+   10:35   0:00 grep --color=auto scanvirus

Can someone explain how linux is reporting two running scanvirus, but the code has no recursion?

I know every function of this code. I’m baffled as to what is happening.

You script has shell builtin command at the right hand side of pipeline. Like

cat | read

Look at PPID of your processes.

I have lots of pipeline commands and $(command). The #2 is subshell command that pipes date to the string.

How do I tell which is the top level command?

They are the same command ‘scanvirus -a u’.

#pstree
 ├─konsole─┬─bash───su───bash───scanvirus─┬─clamscan
 *****************************************└─scanvirus