我试图定义一个字符串X =“或者'这个'那个'”但GNU make不会接受它(I am trying to define a string X=“either '

系统教程 行业动态 更新时间:2024-06-14 16:57:41
我试图定义一个字符串X =“或者'这个'那个'”但GNU make不会接受它(I am trying to define a string X=“either 'this|that'” but GNU make won't accept it)

我正在尝试为GNU make编写一个Makefile。 我无法弄清楚这里的问题是什么:

foo := this|works bar := "I lost my 'single quotes'" baz := 'make|will|not|accept|this|with|the|single|quotes' whatIWant := "A string with its 'single|quoted|regex|alternatives'" this-almost-works: #But the single quotes are lost. @printf '%s ' "$(whatIWant)" this-fails-horribly: @printf '$(whatIWant)'

我收到以下错误消息

/bin/sh: 1: quoted: not found /bin/sh: 1: /bin/sh: 1: regex: not foundalternatives": not found blah blah Error 127

为什么尝试在shell中运行此字符串的一部分?

如何定义变量以准确包含whatIWant的内容?

I am trying to write a Makefile for GNU make. I can't figure out what the problem is here:

foo := this|works bar := "I lost my 'single quotes'" baz := 'make|will|not|accept|this|with|the|single|quotes' whatIWant := "A string with its 'single|quoted|regex|alternatives'" this-almost-works: #But the single quotes are lost. @printf '%s ' "$(whatIWant)" this-fails-horribly: @printf '$(whatIWant)'

I get the following error message

/bin/sh: 1: quoted: not found /bin/sh: 1: /bin/sh: 1: regex: not foundalternatives": not found blah blah Error 127

Why is it trying to run parts of this string in the shell?

How can I define a variable to contain exactly the contents of whatIWant?

更多推荐

本文发布于:2023-04-13 12:52:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/dzcp/c48a6cda609fa8086b852f1ac98a526c.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:字符串   定义   GNU   define   string

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!