【发布时间】:2018-03-24 19:56:13
【问题描述】:
文件夹结构是这样设置的:
Main directory
\_ keyspaces
\_ f1
\_ bootstrap.cql
\_ anotherFolder
\_ 0001-something.cql
\_ f2
\_ bootstrap.cql
\_ anotherFolder
\_ 0001-something.cql
\_ 0002-moreSomething.cql
我在主目录中有一个包含此代码的 Makefile:
do_stuff:
for ks in keyspaces/*; do \
cqlsh -f "$${ks}/bootstrap.cql"; \
done
当我从主目录内的终端(使用 iTerm2)运行 make do_stuff 时,出现错误,说明如下:
Can't open 'keyspaces/f1/bootstrap.cql': [Errno 2] No such file or directory: 'keyspaces/f1/bootstrap.cql'
command terminated with exit code 1
Can't open 'keyspaces/f2/bootstrap.cql': [Errno 2] No such file or directory: 'keyspaces/f2/bootstrap.cql'
command terminated with exit code 1
make: *** [do_stuff] Error 1
但是,如果我在终端中运行此程序:cat keyspaces/f1/bootstrap.sql 我会打印出该文件的内容,因此路径正确且确实存在,但 cqlsh 无法识别它?
查看the Cassandra/cqlsh docs,看起来我正在正确使用-f 命令,所以我不知道为什么会出现错误。
【问题讨论】:
-
cat keyspaces/f1/bootstrap.cql怎么样?
标签: makefile cassandra cql cqlsh iterm2