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

#!/bin/sh
# Usage example: sh processid.sh kate dolphin gnome-terminal
# Loop through each input value
#
for PID in $@; do
PROCESSPRNT=$(ps l -C $PID | awk '{print $3}' | tail -n +2)
if [[ $(echo $PROCESSPRNT | wc -w) -ne 0 ]]; then
echo -e "\n'$PID': All process IDs (PID) are:\n\n$PROCESSPRNT\n"
echo -e "Total: $(echo $PROCESSPRNT | wc -w)\n"
else
echo -e "\n'$PID': No process found running.\n"
fi
done
####
#DEPRECATED
# Array of processes
#BIN_PATTERN=(
#dolphin
#gigole
#)
#for PID in ${BIN_PATTERN[*]}; do
#DEPRECATED
####