【发布时间】:2012-06-21 00:31:25
【问题描述】:
我见过一些 shell 脚本,它们通过在同一个 shell 脚本中写入文件的内容来传递文件。例如:
if [[ $uponly -eq 1 ]]; then
mysql $tabular -h database1 -u usertrack -pabulafia usertrack << END
select host from host_status where host like 'ld%' and status = 'up';
END
exit 0
fi
我已经能够做类似的事情:
python << END
print 'hello world'
END
如果脚本的名称是myscript.sh,那么我可以通过执行sh myscript.sh 来运行它。我得到了我想要的输出。
问题是,我们可以在 Makefile 中做类似的事情吗?我一直在环顾四周,他们都说我做了类似的事情:
target:
python @<<
print 'hello world'
<<
但这不起作用。
这是我一直在寻找的链接:
http://www.opussoftware.com/tutorial/TutMakefile.htm#Response%20Files
【问题讨论】:
标签: python makefile response inline