Saya memiliki yang berikut dalam sebuah file
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.
'''
dengan beberapa hal lain dalam file ini.
Saya mengekstrak bagian ini dalam skrip shell saya melalui sed -n "/'''/,/'''/p" $1
(di mana $1
file).
Ini memberi saya variabel dengan konten sebagai satu liner
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. '''
Bagaimana saya sekarang dapat mengekstrak bagian antara '''
?
Atau bahkan ada cara yang lebih baik untuk mengambilnya dari file multiline?
Saya menggunakan Mac El Captain 10.11.2 dan GNU bash, versi 3.2.57 (1) -release (x86_64-apple-darwin15)