I want to change this:
--- BEGINNING OF file.txt ---
# use another authentication method.
# TYPE DATABASE USER ADDRESS METHOD
# "local" is for Unix domain socket connections only
local all all
--- END ---
... to this:
--- BEGINNING OF file.txt ---
# use another authentication method.
# TYPE DATABASE USER ADDRESS METHOD
--- END ---
Here's my latest attempt ("-i" to be added):
sed "s/^\(.*type\s*database\s*user\s*address\s*method\).*$/\1/i" file.txt
Thank you!