的文件夹结构设置,像这样的时候:“没有这样的文件或目录”运行的Makefile脚本
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'? – Beta