ansible -m copy -a "src=an.sh dest=/tmp/ mode=755" all
ansible -m shell -a "sh /tmp/an.sh" all
sed 匹配ps -ef 后面增加备份
sed -i '/appName=/a\mv ${appName} ${appName}.bak' /opt/kubiex/scripts/*.sh
#!/bin/bash
匹配target\/\${appName}\" 替换 增加 && echo
sed -i 's#target\/\${appName}\"#target\/\${appName}\" \&\&\ echo\ #g' /opt/kubiex/scripts/*.sh
网友评论