![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | 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 here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| greping date in a file | ali560045 | Shell Programming and Scripting | 3 | 02-20-2008 04:30 AM |
| need help in greping | ali560045 | Shell Programming and Scripting | 4 | 02-12-2008 03:40 AM |
| greping with time stamp | arunkumar_mca | Shell Programming and Scripting | 1 | 07-28-2006 01:20 AM |
| GREPing for Nulls | Dr. DOT | UNIX for Dummies Questions & Answers | 4 | 09-17-2004 12:28 PM |
| Help with greping a field | rooh | UNIX for Dummies Questions & Answers | 7 | 09-08-2003 09:42 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
||||
|
||||
|
Greping certain lines
One of my outout is like this as shown below. How can I grep only the lines after the line "Affected files ...". No of lines after the line "Affected files ..." may vary.
$ cat file_A Change 149133 by csaha@test_depo_csaha on 2006/02/08 01:40:57 *pending* This is to test change # Affected files ... ... //depot/users/csaha/chirantan/R&D1.doc#1 edit ... //depot/users/csaha/my-scripts/ecmsbuild.sh#2 edit ... //depot/users/csaha/my-scripts/eta noster gora.txt#1 add ... //depot/users/csaha/my-scripts/fs-dtls.sh#2 edit ... //depot/users/csaha/my-scripts/fs_usage_monitor.sh#2 edit ... //depot/users/csaha/my-scripts/server_info.sh#2 edit |
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
You could do this.
Code:
sed -n -e '/Affected files/,$p' | grep needle |
|
#3
|
||||
|
||||
|
Thanks for the code dude
Only this was enough Code:
$ cat file_A | sed -n -e '/Affected files/,$p' Affected files ... ... //depot/users/csaha/chirantan/R&D1.doc#1 edit ... //depot/users/csaha/my-scripts/ecmsbuild.sh#2 edit ... //depot/users/csaha/my-scripts/eta noster gora.txt#1 add ... //depot/users/csaha/my-scripts/fs-dtls.sh#2 edit ... //depot/users/csaha/my-scripts/fs_usage_monitor.sh#2 edit ... //depot/users/csaha/my-scripts/server_info.sh#2 edit |
|
#4
|
||||
|
||||
|
Code:
cat file_A | sed -n -e '/Affected files/,$p' Code:
sed -n -e '/Affected files/,$p' file_A |
|
#5
|
||||
|
||||
|
UUOC means ?
|
| Thread Tools | Search this Thread |
| Display Modes | |
|
|