Home sed--append-text-to-a-line-with-a-pattern
Post
Cancel

sed--append-text-to-a-line-with-a-pattern

The following will append ‘,doubletake_servers’ to the end of a line containing ‘hostgroups’

sed '/hostgroups/ s/$/ ,doubletake_servers/' filename.cfg

This post is licensed under CC BY 4.0 by the author.