Macros Term宏字符串中的转义字符?

Macros Term宏字符串中的转义字符?,macros,terminal,Macros,Terminal,我正在编写一个Term宏,我需要指定一个字符串变量,该变量包含“和”。我查阅了各种教程,但没有找到如何执行此操作的说明,因此希望它存在 这些字符串变量不起作用: hello = "command1 argument1 "foo/hello/world.txt"" world = 'command2 argument2 'bar/hello/world.txt'' 给定的语法错误为: 通过实验,我发现我可以混合和匹配单引号和双引号,以允许其中一个或另一个,但不能同时允许两者 这些字符串变量可

我正在编写一个Term宏,我需要指定一个字符串变量,该变量包含
。我查阅了各种教程,但没有找到如何执行此操作的说明,因此希望它存在

这些字符串变量不起作用:

hello = "command1 argument1 "foo/hello/world.txt""
world = 'command2 argument2 'bar/hello/world.txt''
给定的语法错误为:


通过实验,我发现我可以混合和匹配单引号和双引号,以允许其中一个或另一个,但不能同时允许两者

这些字符串变量可以工作:

foo = "command1 argumen1t 'foo/hello/world.txt'"
bar = 'command2 argument2 "bar/hello/world.txt"'

我不确定字符串是否有转义字符(我搜索过,但没有找到任何相关内容),但是我找到了一种解决方法。我不是说这是正确的方法,但至少它可能适合您的情况

为了发送引号,我使用了的ASCII值特性(函数中的实际文档)

通过测试上述宏,可以在终端中输入以下内容

command1 argument1 "foo/hello/world.txt"
command2 argument2 'bar/hello/world.txt'
command1 argument1 "foo/hello/world.txt"
command2 argument2 'bar/hello/world.txt'