Issue
I'm not real familiar yet with using sed, and am trying to delete this line in an apache .conf file:
"%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"
I've attempted many different variations of something similar to this, with no luck so far:
sed '/\%t \%h/d' /etc/apache2/conf.d/ssl.conf
but always end up with this error:
sed: bad option in substitution expression
I know I'm missing something very easy here, but I've run out of patience dealing with it (you know how it goes), lol.
Anyone?
Solution
If you're trying to delete the entire lines, fgrep -v
may be a better option:
fgrep -v '%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x "%r" %b' /etc/apache2/conf.d/ssl.conf
but if it truly needs to be sed, this should work:
sed 's/%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x "%r" %b//' /etc/apache2/conf.d/ssl.conf
Answered By - dudebro Answer Checked By - Cary Denson (WPSolving Admin)