This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #! /bin/bash | |
| # I don't know it's correct or not; at least it works for me. | |
| {YOUR_COMMAND} & # make sure your command will end | |
| pid=$! | |
| kill -s STOP ${pid} | |
| sudo stdbuf -oL tcplife -p ${pid} -s > otuput.csv & | |
| tcplife_pid=$! | |
| sleep 5 | |
| kill -s CONT ${pid} | |
| wait ${pid} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "context" | |
| "fmt" | |
| "net/http" | |
| "os/signal" | |
| "syscall" | |
| "time" |