carlessanagustin
6/7/2017 - 10:01 AM

Kill processes

Kill processes

#!/bin/bash

array=("process1" "process2")

for item in ${array[*]}
do
	printf "Killing process..."
	printf " %s\n" $item
	kill `ps -ef | grep -i $item | grep -v grep | awk '{print $2}'`
done