1. #!/bin/sh
  2. ### find pid
  3. jps=`jps -m`
  4. echo "$jps"|while read i
  5. do
  6. if[[ $i =~"agentTestTopic"]];
  7. then
  8. #将字符串分割成数组
  9. OLD_IFS="$IFS"
  10. IFS=" "
  11. arr=($i)
  12. IFS="$OLD_IFS"
  13. echo ${arr[0]}
  14. pid=${arr[0]}
  15. kill -9 $pid
  16. fi
  17. done
  18.  
  19. echo "agentTestTopic is stoped"

相关文章:

  • 2021-08-30
  • 2022-12-23
  • 2021-07-01
  • 2022-12-23
  • 2021-12-02
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-06-15
  • 2021-12-14
  • 2022-12-23
  • 2022-01-07
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案