Created
December 3, 2017 23:25
-
-
Save davidraedev/56ed12c8be146d0dc5d258d4086fa3e2 to your computer and use it in GitHub Desktop.
pidof implementation for Mac / OSX / MacOS
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
function pidof() { | |
if [ -z "$1" ]; then | |
echo 'pidof PROCESS'; | |
return 1; | |
fi; | |
ps aux | grep -v grep | grep "$1" | awk '{print $2}'; | |
} |
True! Although if you're on a system that doesn't have homebrew this will work in a pinch.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Or just