在shell中执行docker shell命令返回结果给变量
function test(){ result=(`bash -c "$1"`) echo ${result[0]} } test "docker exec mysql /bin/bash -c 'mysql -u root -ppassw0rd -V'"
在shell中执行docker shell命令返回结果给变量
function test(){ result=(`bash -c "$1"`) echo ${result[0]} } test "docker exec mysql /bin/bash -c 'mysql -u root -ppassw0rd -V'"