ansible xx-m shell -a "ps -ef | grep tomcat | grep -v grep | awk '{print $2}'" 提取tomcat的进程pid回失败,原因是ansible 设别awk的$ 符号有问题

改成ansible aecc -m shell -a "ps -ef | grep tomcat | grep -v grep | awk '{print \$2}'" 

或者把命令写成脚本,远程执行脚本

相关文章:

  • 2021-08-16
  • 2021-05-27
  • 2022-12-23
  • 2022-12-23
  • 2021-07-12
  • 2021-05-23
  • 2021-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-12-23
  • 2021-12-31
  • 2022-12-23
  • 2021-06-25
相关资源
相似解决方案