On 10/21/18 11:13 AM, Brian Wengel wrote:
> It seem you can only exit “tail –f…” sending *CTRL+C*, but that can be an
> issue if you call it from another process that you want to keep running
> after tail has exited.
>
> Another example is “start daemon; tail -F logfile; stop daemon” as
> user2394284 commented in this StackExchange
> <https://askubuntu.com/questions/36785/tail-how-to-quit-tail-and-restore-terminal-window>
> thread.
The tail implementation in the GNU coreutils already know a option
to terminate itself when a process of a certain PID died:
$tail --help | grep PID
--pid=PID with -f, terminate after process ID, PID dies
Isn't this sufficient?
Thanks & have a nice day,
Berny