Difference between revisions of "Unix helpers"
From Blue-IT.org Wiki
(→sed) |
|||
Line 3: | Line 3: | ||
sed -i '/"Text in the line before"/s@"Text in the line before"@&\n\tNEW_TEXT_IN_LINES_AFTER@' \ | sed -i '/"Text in the line before"/s@"Text in the line before"@&\n\tNEW_TEXT_IN_LINES_AFTER@' \ | ||
/etc/yourscript | /etc/yourscript | ||
+ | |||
+ | [[Category:Scripting]] |
Revision as of 20:17, 8 January 2012
sed
Add a line into a given script
sed -i '/"Text in the line before"/s@"Text in the line before"@&\n\tNEW_TEXT_IN_LINES_AFTER@' \ /etc/yourscript