0

I am trying to replace parameters in a config file using sed. The parameters are clearly marked as "". I'm trying to change

answer: <YOUR ANSWER HERE>

to

answer: answer

My sed command:

sed -i '/s/<ADD ANSWER HERE>/answer/' config.yaml

error is

sed: -e expression #1, char 4: unknown command: `<'

I've tried using " and escaping with \<

0

1 Answer 1

6

You simply have an extra / at the beginning, which confused sed into thinking that you want to perform a command (called <) on a line that matches the pattern /s/. Instead, use:

sed -i 's/<ADD ANSWER HERE>/answer/' config.yaml

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .