$ps -fu $USER UID PID PPID C STIME TTY TIME CMD kanoujip 22471 21858 0 Sep16 pts/3 00:00:00 /bin/sh ./Alert_notification.sh kanoujip 27450 27390 0 Sep16 ? 00:00:00 sshd: kanoujip@pts/9
I want to run another time ./Alert_notification.sh
again so want to kill all previous runs from my User ID
How can I achieve this ?
ps -fu $USER | grep Alert_notification.sh |grep -vE 'grep|"$PPID"' | awk '{print $2}' | xargs kill `ps -o pid= -N T` ;
terminates all the MY USER session
grep -v grep
.grep|$PPID
? The the'
suppresses parameter expansion.