cat uniq.txt | while read line; do sed -i “0,/KaTeX parse error: Expected '}', got 'EOF' at end of input: line/{/line/d;}” meta; done
//只删除匹配到的第一行
附上sed说明:
A line number of 0' can be used in an address specification like
0,/REGEXP/’ so that sed' will try to match REGEXP in the first input line too. In other words,
0,/REGEXP/’ is similar to
1,/REGEXP/', except that if ADDR2 matches the very first line of input the
0,/REGEXP/’ form will consider it to end the range,
whereas the `1,/REGEXP/’ form will match the beginning of its
range and hence make the range span up to the second occurrence
of the regular expression.