Sponsored Content
Top Forums Shell Programming and Scripting Print remaining lines using grep Post 302987412 by rohit_shinez on Thursday 8th of December 2016 11:28:38 PM
Old 12-09-2016
Yeah got the sorted, thanks guys is there a way to add multiple pattern search of string

Code:
ERROR - Not a valid
ID : 123


ERROR - Not a valid
hello
+ echo ID : 124

SUCCESS - Valid
ID : 12

WARNING

IGNORE ERROR

Desired output
Code:
There is Error for ID 123

There is Error for ID 12

WARNING

Tried below
awk '($0 ~ /ERROR|WARNING/){Q=$0;next} ($1 ~ /ID/){print Q ORS "There is Error for ID " $NF}' test.txt

i need to exlcude IGNORE ERROR
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

print remaining file after a condition is satisfied

Hi , could any one suggest me that how to determine if the first field is numeric and if it is greater than another number then from that point everything else should be printed using awk. I have tried this : awk -v xxxx=$xxxxx ' BEGIN { enable=0 } { print $1 if ( ( $1 !~ "^*$" ... (5 Replies)
Discussion started by: hitmansilentass
5 Replies

2. Shell Programming and Scripting

Print lines after grep

Hi all, I need help in following scenario. I have a file with about 10,000 lines. There are several lines which have word "START" (all upper case) in them. I want to grep line with word "START" and then do the following 1. Print the line number having word "START" 2. Print the next 11 lines. ... (4 Replies)
Discussion started by: jakSun8
4 Replies

3. UNIX for Dummies Questions & Answers

print remaining part from the first-match within a file

Hi, i was looking for unix command(s) for : find the first occurrence of a given pattern with in a file and print the remaining part. below is an example of what i am looking for: lets say, a file named myfile.txt now, the command i am looking for will do the following (4 Replies)
Discussion started by: nurulamin862
4 Replies

4. Shell Programming and Scripting

AIX equivalent to GNU grep's -B and -A [print lines after or before matching lines]

Hi folks I am not allowed to install GNU grep on AIX. Here my code excerpt: grep_fatal () { /usr/sfw/bin/gegrep -B4 -A2 "FATAL|QUEUE|SIGHUP" } Howto the same on AIX based machine? from manual GNU grep ‘--after-context=num’ Print num lines of trailing context after... (4 Replies)
Discussion started by: slashdotweenie
4 Replies

5. Shell Programming and Scripting

Print lines between two lines after grep for a text string

I have several very large file that are extracts from Oracle tables. These files are formatted in XML type syntax with multiple entries like: <ROW> some information more information </ROW> I want to grep for some words, then print all lines between <ROW> AND </ROW>. Can this be done with AWK?... (7 Replies)
Discussion started by: jbruce
7 Replies

6. Shell Programming and Scripting

Print the above and below lines for the grep pattern.

Hi, i would like to get the above and below lines of the grep pattern . For ex : file as below: chk1- aaaa 1-Nov chk2 -aaaa ########## chk1-bbbbbb 1-Nov chk2-bbbbbb ######### my search pattern is date : 1-Nov i need the o/p as below chk1- aaaa 1-Nov (6 Replies)
Discussion started by: expert
6 Replies

7. Shell Programming and Scripting

Print lines before and after..not grep -A

Hi I have this in my file 2011-04-18 15:32:11 system-alert-00012: UDP flood! From xxxxxx to yyyyyyyyyy, int ethernet0/2). Occurred 1 times. 2011-04-18 15:32:11 system-alert-00012: UDP flood! From xxxxxx to yyyyyyyyyy, int ethernet0/2). Occurred 1 times. 2011-04-18 15:32:11... (9 Replies)
Discussion started by: zorrox
9 Replies

8. Shell Programming and Scripting

How to print N number of lines before and after the grep?

Hi , My record file , need to print up to above (DATA array)(there may be n no lines ) , grep "myvalue" row now .....suggest me some options --- DATA Array--- record type xxxxx sequence type yyyyy 2 3---> data1 /dev/ --- DEVICE --- MAXIMUM_People= data_blocks= MY_value=2 xyz abc ... (0 Replies)
Discussion started by: Huvan
0 Replies

9. Shell Programming and Scripting

Awk: duplicate column and print remaining as is

Hello there I'd like to make a copy of 2nd column and have it printed in place of column 1. Remaining columns are needed as it. test data: ProbeSet GeneSymbol X22565285 X22566285 ILMN_1050008 MYOCD 6.577 7.395 ILMN_1050014 GPRC6A 6.595 6.668 ILMN_1050017 ... (2 Replies)
Discussion started by: genome
2 Replies
IPS(4)							   BSD Kernel Interfaces Manual 						    IPS(4)

NAME
ips -- IBM/Adaptec ServeRAID controller driver SYNOPSIS
To compile this driver into the kernel, place the following lines in your kernel configuration file: device pci device scbus device ips Alternatively, to load the driver as a module at boot time, place the following line in loader.conf(5): ips_load="YES" DESCRIPTION
The ips driver claims to support the IBM (now Adaptec) ServeRAID series SCSI controller cards. These cards come with a built in configuration utility stored in the firmware known as the ISPR. This utility is accessed with the <Ctrl+I> key combination during the initial card POST. It is highly recommended that this utility be used to configure the card before attempting to diagnose the below error messages. In some cases, the ips driver can have difficulties attaching during the system initialization period. To avoid these difficulties, set the hw.ips.0.disable tunable to 1. It will prevent the driver from attaching. HARDWARE
Controllers supported by the ips driver include: o IBM ServeRAID 3H o ServeRAID 4L/4M/4H o ServeRAID Series 5 o ServeRAID 6i/6M o ServeRAID 7t/7k/7M Newer ServeRAID controllers are supported by the aac(4) or mfi(4) driver. DIAGNOSTICS
Several error codes may be shown when the card initializes the IBM ISPR utility and are independent of FreeBSD. ips%d: failed to get adapter configuration data from device ips%d: failed to get drive configuration data from device Unable to obtain adapter or drive configuration. ips%d iobuf error A buffer input/output error has occurred. [ENXIO] General adapter errors: Attaching bus failed This message is undocumented. WARNING: command timeout. Adapter is in toaster mode, resetting A command timeout has caused the adapter to be reset. AIEE! adapter reset failed, giving up and going home! Have a nice day An error occurred while attempting to reset the adapter. unable to get adapter configuration unable to get drive configuration There was an error when attempting to get configuration information. Adapter error during initialization. adapter initialization failed There was an error while attempting to initialize the adapter. adapter failed config check adapter clear failed There was an error while checking the adapter. device is disabled The adapter is disabled. resource allocation failed irq allocation failed irq setup failed The driver was unable to allocate resources for the device. Error messages due to DMA: can't alloc command dma tag can't alloc SG dma tag can't alloc dma tag for statue queue dmamap failed Failure to map or allocate DMA resources. Cache, buffer, and command errors: failed to initialize command buffers no mem for command slots! The ips driver will return [ENOMEM] in such cases. ERROR: unable to get a command! can't flush cache! ERROR: cache flush command failed! ERROR: unable to get a command! can't update nvram ERROR: nvram update command failed! ERROR: unable to get a command! can't sync cache! ERROR: cache sync command failed! ERROR: unable to get a command! can't sync cache! ERROR: etable command failed! COMPATIBILITY
Unlike many of the other SCSI devices in FreeBSD, the ips driver does not use the cam(4) SCSI subsystem. SEE ALSO
aac(4), ch(4), da(4), mfi(4), sysctl(8) AUTHORS
The ips driver was written by David Jefferys and Scott Long <scottl@FreeBSD.org>. This manual page was written by Tom Rhodes <trhodes@FreeBSD.org>. BSD
August 7, 2009 BSD
All times are GMT -4. The time now is 08:09 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy