The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



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
Adding a columnfrom a specifit line number to a specific line number Ezy Shell Programming and Scripting 2 05-12-2008 09:29 AM
Appending line number to each line and getting total number of lines chiru_h Shell Programming and Scripting 2 03-25-2008 10:19 AM
extracting a line based on line number narendra.pant Shell Programming and Scripting 2 09-20-2007 06:00 AM
Unix Script with line number at beginning of each line. mascorro Shell Programming and Scripting 5 06-19-2006 05:34 PM
identifying duplicates line & reporting their line number stresslog UNIX for Dummies Questions & Answers 5 04-24-2006 01:43 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 08-04-2007
bishweshwar bishweshwar is offline
Registered User
  
 

Join Date: Sep 2006
Posts: 56
getting the line number by extracting a line

grep "KeyNotFoundException" weblogic.log

After running this command the output is

abcxyzexceptions.KeyNotFoundException: Person not found

How to know ..what is the line number of the above string in the log file.
  #2 (permalink)  
Old 08-04-2007
matrixmadhan matrixmadhan is offline Forum Advisor  
Technorati Master
  
 

Join Date: Mar 2005
Location: leaf node in B+ tree
Posts: 2,953
Code:
awk '/KeyNotFoundException/ { print NR }' filename
  #3 (permalink)  
Old 08-04-2007
reborg's Avatar
reborg reborg is online now Forum Staff  
Administrator
  
 

Join Date: Mar 2005
Location: Ireland
Posts: 4,211
use
Code:
grep -n
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 12:23 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0