![]() |
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 |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Delete first line from file and more.... | dfb500 | Shell Programming and Scripting | 6 | 07-02-2009 11:04 AM |
| Delete a line from a file | rohini | UNIX for Dummies Questions & Answers | 8 | 01-07-2009 06:34 AM |
| delete line in file with sed | forever_49ers | Shell Programming and Scripting | 8 | 09-12-2007 09:39 AM |
| delete line in a file | dta4316 | Shell Programming and Scripting | 12 | 05-18-2005 11:20 AM |
| Delete line(s) from file | elchalateco | UNIX for Dummies Questions & Answers | 4 | 10-11-2002 02:25 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
How to delete line from a file
Hi ,
I have a file it content is like that /vol.nas/u08/aip_triage/hany/Tesko/:CC::RPAS /home/biblawh/myscript:CC::RPAS i need to search for a certain pattern inside that file and delete the line if i find this pattern without redirecting the output into another file . so i used the following code but i have problem when the pattern that i am looking for is not in the first line : DelLine=`awk -F':' '{ if ("'"$DPATH"'" == $1) print NR }' file2.txt` echo $DelLine /bin/echo "/$DelLine/d\nwq!" | ex -s file2.txt any clue how can i do that ? |
![]() |
| Bookmarks |
| Tags |
| sed delete line |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|