|
|||||||
| Forums | Search Forums | Register | Forum Rules | Man Pages | Albums | FAQ | Members | 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. |
|
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
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
|
||||
|
||||
|
Can you please post the content of XXX_result.txt and also post the desired output you want from this file?
|
| Sponsored Links | ||
|
|
#3
|
||||
|
||||
|
There is maybe nothing more...
|
|
#4
|
|||
|
|||
|
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
|
|||
|
|||
|
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
|
||||
|
||||
|
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
|
||||
|
||||
|
so can you tell me if this is even posisble how to see line below hardware uisng awk?
Last edited by vbe; 11-29-2012 at 11:48 AM.. |
| Sponsored Links | ||
|
![]() |
| Thread Tools | Search this Thread |
| 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 |
|
|