Skip to content

Instantly share code, notes, and snippets.

@cekstam
Last active October 14, 2022 07:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cekstam/f7ecbc0edf116adafb0401424af6ee75 to your computer and use it in GitHub Desktop.
Save cekstam/f7ecbc0edf116adafb0401424af6ee75 to your computer and use it in GitHub Desktop.
Bash loop for attaching strace to a not yet created process
while true; do pid=$(pgrep 'httpd' | head -1); if [[ -n "$pid" ]]; then sudo strace -s 2000 -vvtf -p "$pid" ; break; fi; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment