When I run printf '<a>'
I get what I expect.
When I run printf \'<a>\'
I get ... cannot find the file specified.
When I am executing printf from NodeJS v6.11.3 it is forcing the latter. Anyone know why and how I might get past this?
I am running git bash on Windows.
答案 0 :(得分:4)
如果您使引号不特殊(通过转义它们),则<
将成为重定向并尝试从名为a
的文件重定向stdin。您只需要找到正确的引用/转义,以确保printf
没有太多的转义。
如果您尝试打印单引号,请尝试
printf "'<a>'"