I have the following text:
client_encryption_options:
enabled: true
# If enabled and optional is set to true encrypted and unencrypted connections are handled.
optional: false
keystore: conf/.keystore
keystore_password: cassandra
I am trying to change the value in the keystore under client_encryption_options using the sed command.
sed "/^client_encryption_options:/,+1s/keystore:.*/keystore: \/opt\/test/" $CASSANDRA_YAML_FILE > cassandra.yaml.tmp && mv cassandra.yaml.tmp $CASSANDRA_YAML_FILE
When I try the above command it doesn't replace the conf/.keystore with /opt/test/
^client_encryption_options:
and +4 more). As long as the pattern is unique, it will change the wanted line, no matter where amongst the four lines it is. – Kusalananda Feb 15 '17 at 15:52