Skip to content

Instantly share code, notes, and snippets.

@Rojo
Last active June 6, 2018 03:41
Show Gist options
  • Save Rojo/71976d00d012396acdf3 to your computer and use it in GitHub Desktop.
Save Rojo/71976d00d012396acdf3 to your computer and use it in GitHub Desktop.
bash + awk with backticks
!/bin/bash
PID=`ps -eo pid,args | awk '/[[:digit:]]+ $1/ { print $1 }'`
echo $PID
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment