#!/bin/bash
#display the process information for gedit
ps aux | egrep "gedit|PID"
#print the process id and kill gedit
for pid in $(pgrep 'gedit');
do
echo $pid;
kill $pid;
done
#another way to kill gedit
for pad in $(pidof "gedit");
do
kill $pad;
done