![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | 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 !! |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| reading lines | c0mrade | Shell Programming and Scripting | 4 | 05-17-2008 01:22 PM |
| reading lines in pairs from file in ksh | ytokar | Shell Programming and Scripting | 4 | 02-08-2008 11:50 AM |
| Reading lines in a file matching a pattern | torenji | Shell Programming and Scripting | 4 | 10-25-2007 01:15 AM |
| Reading lines within vi editor | asriva26 | Shell Programming and Scripting | 2 | 08-30-2006 06:47 AM |
| Reading lines within a Unix file. | mariner | UNIX for Advanced & Expert Users | 5 | 11-18-2003 10:26 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
skip reading certain lines in a file
How can I exclude reading lines in a file that contains the following:
filesystem:/home/pach/liv_patches 128005120 88456640 37270758 71% /home/patches That is, all lines that contain and begins with filesystem: should not be processed/read from a file |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
sed -e "/^filesystem:/d" filename
or grep -v "^filesystem:" filename |
|
#3
|
|||
|
|||
|
Hi hagemaro,
I think your solution will only serve the purpose when the word "filesystem" is at the begining. Please correct if i am wrong. Cheers |
|
#4
|
|||
|
|||
|
Try this out... This will not show any lines containing the specified word.
Code:
sed '/filesystem/d' filename grep 'filesystem' filename |
|
#5
|
|||
|
|||
|
Quote:
|
|
#6
|
|||
|
|||
|
Quote:
|
|||
| Google The UNIX and Linux Forums |