Instructions to set up a basic LAMP+SSH server environment
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
581 B

6 years ago
  1. #!/bin/sh
  2. # Usage example: sh processid.sh kate dolphin gnome-terminal
  3. # Loop through each input value
  4. #
  5. for PID in $@; do
  6. PROCESSPRNT=$(ps l -C $PID | awk '{print $3}' | tail -n +2)
  7. if [[ $(echo $PROCESSPRNT | wc -w) -ne 0 ]]; then
  8. echo -e "\n'$PID': All process IDs (PID) are:\n\n$PROCESSPRNT\n"
  9. echo -e "Total: $(echo $PROCESSPRNT | wc -w)\n"
  10. else
  11. echo -e "\n'$PID': No process found running.\n"
  12. fi
  13. done
  14. ####
  15. #DEPRECATED
  16. # Array of processes
  17. #BIN_PATTERN=(
  18. #dolphin
  19. #gigole
  20. #)
  21. #for PID in ${BIN_PATTERN[*]}; do
  22. #DEPRECATED
  23. ####