User Tools

Site Tools


update_next_line_based_on_list_of_variable

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revisionBoth sides next revision
update_next_line_based_on_list_of_variable [2009/06/04 04:15] – created k2patelupdate_next_line_based_on_list_of_variable [2009/06/04 15:03] k2patel
Line 18: Line 18:
 done done
 </code> </code>
 +
 +==== sed to insert line after string match ====
 +
 +  * -i will allow you to write to file and create backup
 +  * -e will allow for bash expression such as '\t' to be completed (tab insertion)
 +
 +  * usage: '/pattern to find/a the text you want to add'
 +
 +<code bash | quickinsert.sh>
 +
 +sed -i.bak  -e '/type slave/a \\t masters { 71.167.42.205; } ;' named.conf
 +
 +</code>
 +
update_next_line_based_on_list_of_variable.txt · Last modified: 2020/08/10 02:35 by 127.0.0.1