One - One Code All

Blog Content

在脚本中执行docker bash

Linux-Mac 容器化 运维   2015-01-01 22:36:50

在shell中执行docker shell命令返回结果给变量。


test.sh

function test(){
  result=(`bash -c "$1"`)
  echo ${result[0]}
}
test "docker exec -it  airflow /bin/bash -c 'airflow list_dags'"



执行文件:

bash  test.sh


上一篇:PHP扩展高性能日志系统SeasLog
下一篇:python遍历目录,拼接域名

The minute you think of giving up, think of the reason why you held on so long.