There is a debian with a certain utility that runs "from the hand" from the console and can extract from the tcp / ip-stack info on a certain mask and then through the pipeline to give it to tcpdump which translates it into human readable format and gives it to the others text utilities (grep | awk | sed | strings | etc) ... at the end - the result is redirected to the console.

I need to do all this with cron, but the problem is that as long as you do not send this utility to KeyboardInterrupt, it will not release the console and the process will not die.

Sobstvenno question: Somehow you can say the crown, or bash'u, so that after a while he would have nailed this process without crushing another crutch?

An example of how "this" starts:

$ stack_tmux -host 8.8.8.8 -port 53 | tcpdump -nl -s 0 -A -r - | strings | grep -v com | grep hello_world | cut -f 6 -d" " > /test.txt 

    1 answer 1

    you can use, for example, the timeout program from gnu / coreutils :

     $ timeout 1.5 ΠΊΠΎΠΌΠ°Π½Π΄Π° с Π°Ρ€Π³ΡƒΠΌΠ΅Π½Ρ‚Π°ΠΌΠΈ 

    if the ΠΊΠΎΠΌΠ°Π½Π΄Π° с Π°Ρ€Π³ΡƒΠΌΠ΅Π½Ρ‚Π°ΠΌΠΈ does not complete itself within one and a half seconds, the TERM signal will be sent to it. You can also specify another one using the -s сигнал option, for example, the required -s HUP :

     $ timeout -s HUP 100 stack_tmux -host 8.8.8.8 -port 53 | tcpdump ... 

    read more: $ man timeout