I've to kill all running instances of Xvfb using shell script hence have following code -
for pid in $(ps -ef | awk '/Xvfb/ {print $2}'); do kill -9 $pid; done It kills all instances but one fails with following error -
kill: (142898) - No such process Seems above executed command creates one more instance but which no more exists while killing. In this case, how can I skip that and succeed with the script?
pkill Xvfb? Any reason to make it complicated? And why theSIGKILL?