【发布时间】:2017-07-03 09:53:42
【问题描述】:
我正在尝试从 golang 运行 cqlsh shell 命令 'COPY',但它始终是退出状态 2。
cmd := "/path/to/my/cqlsh"
args := []string{`ipaddress -e "COPY keyspace.table (cl1, cl2) to /path/to/file"`}
exec.Command(cmd, args...).Run()
这总是出错。
【问题讨论】:
-
错误是什么?您将 args 作为单个参数传递。
-
args := []string{"ipaddress", "-e",
"COPY keyspace.table (cl1, cl2) to /path/to/file"} ...:1:SyntaxException: 第 1:0 行在输入 'COPY 处没有可行的替代方案....