#!/bin/bash
var=$1
cp ./cat_web_tpl ./cat_web.yaml
sed -i "s/###/${var}/g" ./cat_web.yaml
cat ./cat_web.yaml
sleep 1
ansible-playbook ./cat_web.yaml
cat_web_tpl
---
- hosts: web
vars:
cat4: "cat /var/www/log/php-errors.log|grep Fatal"
clean: "ls -lh /var/www/log; echo '' > /var/www/log/php-errors.log;"
remote_user: centos
become: true
become_user: root
tasks:
- name: cmd
shell: "{{ ### }}"
register: out
- debug: var=out.stdout_lines
最后
以上就是秀丽电源最近收集整理的关于sed 替换 bash shell 可变参数的全部内容,更多相关sed内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复