【发布时间】:2019-02-08 10:45:05
【问题描述】:
我想在我的 makefile 中检索某个子文件夹中的所有文本文件(目前我刚刚得到一个) 并以每个文本文件作为输入参数循环调用特定的 python 脚本。
这是我目前拥有的代码:
run_analysis:
@echo "Get text files"
txt_files=$(wildcard ./input/*.txt)
@echo "Current text files are:"
@echo $(txt_files)
for txt_file in $(txt_files); do \
@echo "Iteration" \
@echo $(txt_file ) \
python ./scripts/my_test_script.py $(txt_file ) ; \
done
似乎通配符结果未存储在变量中。
我的输出如下所示:
Get text files
txt_files=./input/test_text_1.txt
Current text files are:
for txt_file in ; do \
@echo "Iteration" \
@echo \
python ./scripts/my_test_script.py ; \
done
【问题讨论】:
标签: makefile