![]() |
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 |
| grep high bit char | ayyo1234 | UNIX for Advanced & Expert Users | 7 | 02-11-2008 05:01 PM |
| Top and Prstat display different results for memory | zen03 | SUN Solaris | 4 | 12-29-2006 03:28 AM |
| List grep results | slire | UNIX for Dummies Questions & Answers | 14 | 10-31-2006 11:42 AM |
| How to refine results of grep -p | priceb | Shell Programming and Scripting | 2 | 06-28-2006 08:40 AM |
| Multiple Grep Results - Formatting | sysera | Shell Programming and Scripting | 7 | 03-25-2004 06:04 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
How to display first 7 char of grep results?
My file contains the following:
uat2000.aspclient.active=true uat2001.aspclient.active=true uat2002.aspclient.active=true uat2003.aspclient.active=true uat2004.aspclient.active=false uat2005.aspclient.active=false uat2006.aspclient.active=false uat2007.aspclient.active=false uat2008.aspclient.active=false uat2009.aspclient.active=false I am greping which ones = true with # cat filename | grep active=true Results: uat2000.aspclient.active=true uat2001.aspclient.active=true uat2002.aspclient.active=true uat2003.aspclient.active=true QUESTION: I want the results to display only the first 7 characters, ie uat2000, uat2001, etc - HOW DO I DO THAT? Thanks in advance! |
|
||||
|
How to search files and dispaly specific text within the file?
Thank you for your responses. This forum is great! I am very new to the unix environment and just trying to figure things out..
So now that you have helped me with this problem, I realize that what I am really looking for is the solution to this - with the same result as above: 1. From the root directory (or within a script), search all directories below to find any file called Application.properties 2. When an Application.properties file is found, search it for "active=true" result: uat2000.aspclient.active=true uat2001.aspclient.active=true uat2002.aspclient.active=true uat2003.aspclient.active=true 3. Count the lines and display only first 7 characters, ie uat2000, uat2001, etc : uat2000 uat2001 uat2002 uat2003 Thanks A Million! Last edited by kthatch; 04-03-2007 at 06:29 PM.. Reason: Modify Title |
|
|||||
|
Quote:
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|