我的档案中有以下内容
description: '''
This rule forbids throwing string literals or interpolations. While
JavaScript (and CoffeeScript by extension) allow any expression to
be thrown, it is best to only throw <a
href="https://developer.mozilla.org
/en/JavaScript/Reference/Global_Objects/Error"> Error</a> objects,
because they contain valuable debugging information like the stack
trace. Because of JavaScript's dynamic nature, CoffeeLint cannot
ensure you are always throwing instances of <tt>Error</tt>. It will
only catch the simple but real case of throwing literal strings.
<pre>
<code># CoffeeLint will catch this:
throw "i made a boo boo"
# ... but not this:
throw getSomeString()
</code>
</pre>
This rule is enabled by default.
'''
与此文件中的其他几件事。
我通过sed -n "/'''/,/'''/p" $1
($1
文件在哪里)将这部分提取到我的shell脚本中。
这给了我一个变量,内容为一个衬里
description: ''' This rule forbids throwing string literals or interpolations. While JavaScript (and CoffeeScript by extension) allow any expression to be thrown, it is best to only throw <a href="https://developer.mozilla.org /en/JavaScript/Reference/Global_Objects/Error"> Error</a> objects, because they contain valuable debugging information like the stack trace. Because of JavaScript's dynamic nature, CoffeeLint cannot ensure you are always throwing instances of <tt>Error</tt>. It will only catch the simple but real case of throwing literal strings. <pre> <code># CoffeeLint will catch this: throw "i made a boo boo" # ... but not this: throw getSomeString() </code> </pre> This rule is enabled by default. '''
现在如何提取之间的部分'''
?
还是有更好的方法从多行文件中检索它?
我使用的是Mac El Captain 10.11.2和GNU bash版本3.2.57(1)-发行版(x86_64-apple-darwin15)
3
用双引号引起来的变量,然后包含换行符。
—
DisplayName
这是YAML,对不对?您是否没有真正使用YAML解析器的任何原因?
—
查尔斯·达菲
@DisplayName,...要清楚,您的意思是在回显时使用双引号,对吗?
—
查尔斯·达菲