I'm running a command on command line which infinitely generates a certain data and I'm looking for a particular bit of data, so I used
grep to find it. As soon as I get the data, I want the command to kill itself. How do I achieve this?
kill $$ with
grep is not terminating the command.
NOTE2: I saw this question, which does not seem to work in my case.