Difference between revisions of "Unix helpers"

From Blue-IT.org Wiki

 
(sed)
Line 1: Line 1:
 
==sed==
 
==sed==
 
Add a line into a given script
 
Add a line into a given script
  sed -i '/"Text in the line before"/s@"Text in the line before"@&\n\tNEW_TEXT_IN_LINESFTER@' \
+
  sed -i '/"Text in the line before"/s@"Text in the line before"@&\n\tNEW_TEXT_IN_LINES_AFTER@' \
 
  /etc/yourscript
 
  /etc/yourscript

Revision as of 15:32, 26 November 2007

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