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