This is what I'm doing (simplified example):
gsed -i -E 's/^(?!foo)(.*)$/bar1/' file.txt
I'm trying to put bar
in front of every line that doesn't start with foo
. This is the error:
gsed: -e expression #1, char 22: Invalid preceding regular expression
What's wrong?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…