Skip to content

Instantly share code, notes, and snippets.

@s8508235
Created March 18, 2021 09:05
Show Gist options
  • Select an option

  • Save s8508235/1a86037511db51fd14af78b5c272d963 to your computer and use it in GitHub Desktop.

Select an option

Save s8508235/1a86037511db51fd14af78b5c272d963 to your computer and use it in GitHub Desktop.
tcplife a command
#! /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}
sudo pkill -P ${tcplife_pid}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment