1、shell命令中调用python(非shell调用python脚本)
shell_function_name() {
python << EOF
#!/usr/bin/env python
# coding=utf-8
python代码块
EOF
}
shell_function_name
2、shell命令生成脚本(有些情况下我们不能给环境上传代码,通过命令行的方式生成脚本)
cat << EOF > /tmp/a.sh
# 注意shell代码块中的$符要进行转义
shell代码块
EOF
bash a.sh