![]() |
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 |
| Count not correct | popeye | Shell Programming and Scripting | 3 | 04-22-2008 12:50 PM |
| Is the script correct ??? | jaganadh | Shell Programming and Scripting | 0 | 12-13-2007 04:50 AM |
| Tar-ing the correct directories | new2ss | UNIX for Dummies Questions & Answers | 1 | 11-08-2007 10:15 PM |
| Correct the error plz | Mandab | Shell Programming and Scripting | 2 | 05-11-2007 01:15 PM |
| to get the correct value with unsigned int | naan | High Level Programming | 2 | 04-11-2007 06:29 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Quote:
Code:
cut -d"/" -f5 -e "p2" |
|
||||
|
Quote:
Code:
cut -d"/" -f5 -e "p2" Code:
cut -d"/" -f5 | egrep -e "p2" |
|
||||
|
If i do this
cut -d"/" -f5 | egrep -e "p2" it will be grepping on the output because we are using the pipe.... grep pattern a.log|grep -e "p1" |cut -d":" -f1,2,3,4,8,9,10|cut -d"/" -f5 -e "p2" |cut -d":" -f1,2,3,4,6|cut -d"/" -f5 >> file So i used the grep -e I want to search for pattern one do the cutting part then search for pattern two and do the cutting part for that in the same log instead of grepping two times grep pattern a.log|grep "p1" |cut -d":" -f1,2,3,4,8,9,10|cut -d"/" -f5 grep pattern a.log|grep "p2" |cut -d":" -f1,2,3,4,6|cut -d"/" -f5 i have to execute the above command by using grep only once :-) |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|