I'm trying to turn the following:
## Features
feature:foo
feature: baz
into:
## Features
- feature:foo
- feature: baz
I came up with this structure:
sed -i '' 's/^[^#]/- /' $1
but that results in:
## Features
- eature:foo
- eature: baz
FWIW my sed command would have worked fine if I was just trying to add it to the beginning of the line without doing any checks for #, but when I do a pattern match, it eats through one of the existing characters.