Advertisement
uriid1

get pid [linux, bash]

Jul 1st, 2022
698
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/usr/bin/env bash
  2.  
  3. ####--------------------------------####
  4. #--# Author:   by uriid1            #--#
  5. #--# License:  GNU GPL              #--#
  6. #--# Telegram: @foxdacam            #--#
  7. #--# Mail:     appdurov@gmail.com   #--#
  8. ####--------------------------------####
  9.  
  10. # Check pidof installed
  11. if [ -x "$(command -v pidof)" ]; then
  12.     pidof $1
  13. else
  14.     ps aux | grep $1 | awk '{print $2}'
  15. fi
Advertisement
RAW Paste Data Copied
Advertisement