make 中多行
我试图在 make 的变量中存储多行字符串,
var=$(shell cat <<End-of-message \
-------------------------------------\
This is line 1 of the message.\
This is line 2 of the message.\
This is line 3 of the message.\
This is line 4 of the message.\
This is the last line of the message.\
-------------------------------------\
End-of-message)
printit:
@echo ${var}
但这不起作用,所以我想知道这是否可能。我需要在这里保留换行符,shell 正在将它们转换为空格。有什么建议吗?
I am trying to store a multiline string in a variable in make
var=$(shell cat <<End-of-message \
-------------------------------------\
This is line 1 of the message.\
This is line 2 of the message.\
This is line 3 of the message.\
This is line 4 of the message.\
This is the last line of the message.\
-------------------------------------\
End-of-message)
printit:
@echo ${var}
This doesn't work, so I am wondering if this is possible at all. I need to preserve the newlines here and shell is converting them in spaces. Any suggestions?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这个怎么样:
或者这个:
How about this:
or this: