Reputation: 19778
I'd like to do something like timeout 12s tail -f access.log | wc -l
but I'm not seeing the output from wc
. What needs to be done to be able to do this?
Upvotes: 7
Views: 425
Reputation: 785146
Use --foreground
option with timeout
:
timeout --foreground 12s tail -f access.log | wc -l
As per man timeout
:
--foreground when not running timeout directly from a shell prompt,
allow COMMAND to read from the TTY and get TTY signals;
in this mode, children of COMMAND will not be timed out
Upvotes: 5