I am trying to add a property in a config file, directly under the comment describing the property. Here is my test file:
# Filename of SSL Certificate # Filename of SSL RSA Private Key # Filename of SSL Certificate Chain ## ssl_certificate_chain=
I want to add
ssl_certificate=/etc/hue/conf/https.cert
So I’m stuck on what sed option to use. I have tried the
a
a
Using
as delimter due to slashes in substitute value,
-
"a,# Filename of SSL Certificate,ssl_certificate=/etc/hue/conf/https.cert,"
Result:
# Filename of SSL Certificate ,# Filename of SSL Certificate,ssl_certificate=/etc/hue/conf/https.cert, ,# Filename of SSL Certificate,ssl_certificate=/etc/hue/conf/https.cert, # Filename of SSL RSA Private Key ,# Filename of SSL Certificate,ssl_certificate=/etc/hue/conf/https.cert, ,# Filename of SSL Certificate,ssl_certificate=/etc/hue/conf/https.cert, # Filename of SSL Certificate Chain ,# Filename of SSL Certificate,ssl_certificate=/etc/hue/conf/https.cert, ## ssl_certificate_chain= ,# Filename of SSL Certificate,ssl_certificate=/etc/hue/conf/https.cert, ,# Filename of SSL Certificate,ssl_certificate=/etc/hue/conf/https.cert
-
"s,# Filename of SSL Certificate,a ssl_certificate=/etc/hue/conf/https.cert,"
Result:
a ssl_certificate=/etc/hue/conf/https.cert # Filename of SSL RSA Private Key a ssl_certificate=/etc/hue/conf/https.cert Chain ## ssl_certificate_chain=
Anonymous Asked question May 14, 2021
Recent Comments