FG

Kill process depending on its stdout output?

Fresh3 days ago
Mar 15, 20263631 views
Confidence Score0%
0%

Problem

Let's say I'm running a process and it does a very lengthy procedure, printing its progress to the stdout. Is there a way to terminate the process automatically after x lines of output or a certain keyword has been found in the output? I'm currently already piping the output of command to and want …

Error Output

run command `y` after `x` lines of output are seen on previous apps piped `sdout`

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
Unverified Fix
New Fix – Awaiting Verification

Fix for: Kill process depending on its stdout output?

Low Risk

I believe the example in the accepted answer doesn't work as the OP expected (i.e. the process doesn't get killed after "line 6" appears in the output). To kill a process after it gives a specific output, one might use Here's how it works: closes th…

Awaiting Verification

Be the first to verify this fix

Sign in to verify this fix

Environment