简体   繁体   English

我如何回显包含单引号的行?

[英]how can i echo a line containing single quotes?

I want to echo a line containing single quotes but when I am echoing it, the output comes out without the quotes inside that line.我想回显包含单引号的行,但是当我回显它时,输出中没有该行内的引号。 I am using this echo rule_files: [ '${path.config}/folder/*.py' ] and the output is我正在使用这个echo rule_files: [ '${path.config}/folder/*.py' ]并且输出是

rule_files: [ ${path.config}/folder/*.py ] rule_files: [ ${path.config}/folder/*.py ]

I want the output to include the single quotes around the path.我希望输出包含路径周围的单引号。

You have to escape the quotes:你必须转义引号:

echo rule_files: [ \'${path.config}/folder/*.py\' ]

or或者

echo rule_files: [ \''${path.config}/folder/*.py'\' ]

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM