First of all I save in a file all of the working processes.
ps -el > file1
My idea is to count the number of lines in file1 where vi is present.
I tried something like
wc -l | grep vi file1
How is the proper way to do it ?
Your code nearly works, you just have to change
The pipe operator uses the output of the program on the left as input for the program on the right.
Why not using
pgrep man page:
EDIT: (Using the file):