Unix/Linux Go Back    



best method of replacing multiple strings in multiple files - sed or awk? most simple preferred :)

UNIX for Dummies Questions & Answers




Kindly Note - This is a Single User Post by Forum Member rich@ardz Regarding:
best method of replacing multiple strings in multiple files - sed or awk? most simple preferred :).
Please Follow The Primary Link Above to View the Full Discussion.

   
Old Unix and Linux 08-26-2010
rich@ardz rich@ardz is offline
Registered User
 
Join Date: Apr 2010
Last Activity: 22 February 2012, 5:05 AM EST
Posts: 52
Thanks: 12
Thanked 0 Times in 0 Posts
before the sed:


Code:
richard@opensolaris:~/share/shell/ac# wc -l test_big.log
  447940 test_big.log

after the sed:


Code:
richard@opensolaris:~/share/shell/ac# wc -l test_big.log
  447940 test_big.log

That's weird - it's showing the same no. of lines but it definately seems to be striping out the last line - i did a test by just adding a new line at the end of the text file "has this line been deleted" and after running the sed function had ran, that line had indeed been deleted???

Linux

Last edited by Scott; 08-26-2010 at 12:57 PM.. Reason: Added code tags