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?
NOTE1: AND'ing kill $$
with grep
is not terminating the command.
NOTE2: I saw this question, which does not seem to work in my case.
less
. fyi – user2555595 Sep 05 '14 at 10:59