#!/bin/bash if [ "`ps -ef | grep spark-server.jar | grep -v grep | awk '{print $2}'`" ];then ps -ef | grep spark-server.jar | grep -v grep | awk '{print $2}' | xargs kill -9 fi