I have a yaml file that needs to be updated with string containing special characters. Here is the command I used but I get sed expression error
Yaml file (file):
Key1:
Key2:
Command that works without special characters for $var (env variable):
sed -i '0,/^\([[:space:]]*Key1: *\).*/s//\1'$var'/;' file
Value for $var:
fkugoiuhoiuyflkbbui/qy++bfv7J3c
Error I get is:
sed: -e expression #1, char 154: unknown option to `s'
I am trying to figure out how I can get this working. Any help is greatly appreciated. Thanks!