sorry for not being clear  i was only referring to  grep exe  part of the command  other stuff seems fine  also you do not need the  kill sh  script  maybe you can just do something like commands bellow  it looks cleaner imo  pid ps  ef grep httpsrv grep  v grep awk print echo  killing httpsrv pid kill pid 