Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Click here to start participating now! Also, check out the New User Guide.
Script to Remove lines from a file
Name: Justin Date: July 8, 2003 at 08:12:27 Pacific OS: Solaris 8 CPU/Ram: SPARC 64
Comment:
I was wondering if you could help me with a script to remove ALL the lines in a file that contain the word "BOUNDARY". I have the script like this so far, but It will only remove the first occurance of BOUNDRY, not all of them like I want.
#!/bin/bash line=$(grep -n "BOUNDARY" foo.c | cut -d: -f1 | sed '1q' ) sed ${line}d foo.c > foo_new.c
Summary: hi, I am trying to write a script to delete few lines from the existing files. The requirement is as follows: 1. I need to grep for a pattern "abc" in a file and then grep for "xyz" 2. I need to delet...
Summary: Hi All, I want to get the first line from a file and write it into another file. Please help. Thanks in advance. Regards, Raj Thanks & Regards, Raj...
Summary: Hello all, I have wriiten a script to create a html file on the fly. It is as shown below :- 1>echo " " > log.html 2>cat test.log >> log.html 3>echo " " >> log.html The log.html file puts the tes...