![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Script required to get a required info from file. Pls. help me. | ntgobinath | Shell Programming and Scripting | 2 | 05-31-2008 08:34 AM |
| Getting Following problem when opening shell script (Very Urgent) | sunitachoudhury | Shell Programming and Scripting | 1 | 03-31-2008 07:01 AM |
| Urgent: selecting unique specific content of a file using shell script | jisha | Shell Programming and Scripting | 2 | 01-08-2008 08:45 AM |
| Deleting lines inside a file without opening the file | toms | Shell Programming and Scripting | 3 | 09-24-2007 07:58 AM |
| Very Urgent help required in Shell Program | Suppandi | Shell Programming and Scripting | 1 | 12-09-2005 08:33 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread |
Rating:
|
Display Modes |
|
||||
|
Urgent help required in deleting a line without opening a file usinga shell script
Hi,
I need a help in deleting a line matching a particular pattern in a file using shell script without opening the file. The file is a .c/.cpp file. Is it possible? Thanks |
|
||||
|
Quote:
eg. I have a file name.cpp & i wanna delete line with a text "test file". then do it like this cat name.cpp | grep -v "test file" > name.cpp "grep -v "test file" will display the name.cpp without line containing words "test file" & " >name.cpp" will overright the previous file Regds, Girish |
|
||||
|
Hi naan, you can delet th eline by overrighting the file.
eg. I have a file name.cpp & i wanna delete line containing words "test file". then do it like this cat name.cpp | grep -v "test file" > name.cpp "grep -v "test file" will display the name.cpp without line co ntaining words "test file" & " >name.cpp" will overright the previous file Regds, Girish |
|
||||
|
Additional help
Thanks a lot for the input...So can we use the same solution while writing a batch DOS program to delete a particular line from a set of files within a folder so that it recursively goes and delete the line in all the files.
![]() |
![]() |
| Bookmarks |
| Tags |
| sed delete line |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|