awk issue | Unix Linux Forums | Shell Programming and Scripting

  Go Back    


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

awk issue

Shell Programming and Scripting


Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 11-29-2012
Jared Jared is offline
Registered User
 
Join Date: Nov 2012
Last Activity: 19 March 2013, 8:59 PM EDT
Posts: 15
Thanks: 2
Thanked 0 Times in 0 Posts
awk issue

Hi all,

i am trying to use below command to see the output of hardware inventory, but i only see 2 first line no output of the command.


Code:
awk '/Hardware/ {print $0}' XXX_result.txt 
Hardware inventory:
Hardware inventory:

any idea how to see whatever is under hardware inventory.

i will really appreciate your help!

jared

Last edited by Scott; 11-29-2012 at 11:15 AM.. Reason: Code tags
Sponsored Links
    #2  
Old 11-29-2012
Yoda's Avatar
Yoda Yoda is offline Forum Advisor  
Jedi Master
 
Join Date: Jan 2012
Last Activity: 30 October 2014, 6:50 PM EDT
Location: Galactic Empire
Posts: 3,387
Thanks: 235
Thanked 1,209 Times in 1,135 Posts
Can you please post the content of XXX_result.txt and also post the desired output you want from this file?
Sponsored Links
    #3  
Old 11-29-2012
vbe's Avatar
vbe vbe is offline Forum Staff  
Moderator
 
Join Date: Sep 2005
Last Activity: 31 October 2014, 5:04 PM EDT
Location: Switzerland - GE
Posts: 5,840
Thanks: 162
Thanked 417 Times in 392 Posts
There is maybe nothing more...
    #4  
Old 11-29-2012
only4satish only4satish is offline
Registered User
 
Join Date: Jan 2012
Last Activity: 21 August 2014, 5:14 AM EDT
Posts: 62
Thanks: 27
Thanked 2 Times in 2 Posts
your question is not clear, r u trying to to search string hardware in given input file XXX_result.txt ? or just want to display everything in file XXX_result.txt
?
Sponsored Links
    #5  
Old 11-29-2012
Jared Jared is offline
Registered User
 
Join Date: Nov 2012
Last Activity: 19 March 2013, 8:59 PM EDT
Posts: 15
Thanks: 2
Thanked 0 Times in 0 Posts
i like to see output under hardware inventory which is like below...but you can see it only shows Hardware inventory line and thats it!

Code:
 
Item             Version  Part number  Serial number     Description
Chassis                                D3636             M320
Midplane         REV 08   710-009120   TS0977            M320 Midplane
FPM GBUS         REV 05   710-005928   XW5987            M320 Board
FPM Display      REV 05   710-009351   XS5720            M320 FPM Display
CIP              REV 05   710-005926   XW6402            M320 CIP
PEM 0            Rev 08   740-009148   VK57595           DC Power Entry Module
PEM 1            Rev 08   740-009148   VK57527           DC Power Entry Module
PEM 2            Rev 08   740-009148   VK57533           DC Power Entry Module
PEM 3            Rev 08   740-009148   VK57532           DC Power Entry Module
Routing Engine 0 REV 09   740-014082   9009041642        RE-A-2000


Last edited by vbe; 11-29-2012 at 11:46 AM.. Reason: code tags...
Sponsored Links
    #6  
Old 11-29-2012
Yoda's Avatar
Yoda Yoda is offline Forum Advisor  
Jedi Master
 
Join Date: Jan 2012
Last Activity: 30 October 2014, 6:50 PM EDT
Location: Galactic Empire
Posts: 3,387
Thanks: 235
Thanked 1,209 Times in 1,135 Posts
Jared, please post your data samples in code tags.
By the way I don't see string: Hardware anywhere in the data sample you posted. So if you search for string: Hardware using awk, it will print only that particular line.
Sponsored Links
    #7  
Old 11-29-2012
Jared Jared is offline
Registered User
 
Join Date: Nov 2012
Last Activity: 19 March 2013, 8:59 PM EDT
Posts: 15
Thanks: 2
Thanked 0 Times in 0 Posts
so can you tell me if this is even posisble how to see line below hardware uisng awk?


Moderator's Comments:
Video tutorial on how to use code tags in The UNIX and Linux Forums.
Please use code tags next time for your code and data.
This will be your last warning before you will be set readonly...

Last edited by vbe; 11-29-2012 at 11:48 AM..
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
AWK Issue inshafccna Shell Programming and Scripting 1 05-29-2012 07:08 AM
awk NR issue jamie_123 Shell Programming and Scripting 2 11-03-2011 10:41 AM
Awk -if - issue expert Shell Programming and Scripting 4 12-28-2010 01:09 AM
Issue in awk alishehzadpaul Shell Programming and Scripting 2 10-15-2009 08:02 AM
Awk issue gehlnar Shell Programming and Scripting 5 02-06-2009 07:23 AM



All times are GMT -4. The time now is 08:30 AM.