Sponsored Content
Top Forums Shell Programming and Scripting Print remaining lines using grep Post 302987390 by RavinderSingh13 on Thursday 8th of December 2016 02:51:07 PM
Old 12-08-2016
Hello rohit_shinez,

Could you please try following and let me know if this helps.
Code:
awk '($1 ~ /ERROR/){Q=$0;next} ($1 ~ /ID/){print Q ORS "There is Error for ID " $NF}'   Input_file

Output will be as follows.
Code:
ERROR - Not a valid
There is Error for ID 123
ERROR - Not a valid
There is Error for ID 124
ERROR - Not a valid
There is Error for ID 12

Thanks,
R. Singh
 

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
Sys::Virt::Error(3pm)					User Contributed Perl Documentation				     Sys::Virt::Error(3pm)

NAME
Sys::Virt::Error - error object for libvirt APIs DESCRIPTION
The "Sys::Virt::Error" class provides an encoding of the libvirt errors. Instances of this object can be thrown by pretty much any of the Sys::Virt APIs. METHODS
$err->stringify Convert the object into string format suitable for printing on a console to inform a user of the error. my $code = $err->level Return the raw error level represented by this error. One of the ERROR LEVEL CONSTANTS my $code = $err->code Return the raw error code represented by this error. One of the ERROR CODE CONSTANTS my $from = $err->domain Return the error domain raising this error. One of the ERROR DOMAIN CONSTANTS my $msg = $err->message Return an informative message describing the error condition. CONSTANTS
ERROR LEVEL CONSTANTS Sys::Virt::Error::LEVEL_NONE Undefined error level Sys::Virt::Error::LEVEL_WARNING Warning error level Sys::Virt::Error::LEVEL_ERROR Fatal error level ERROR DOMAIN CONSTANTS The error domain indicates which internal part of libvirt the error report was raised from. Sys::Virt::Error::FROM_CONF Configuration file handling Sys::Virt::Error::FROM_DOM Error while operating on a domain Sys::Virt::Error::FROM_DOMAIN Domain configuration handling Sys::Virt::Error::FROM_LXC LXC virtualization driver Sys::Virt::Error::FROM_NET Error while operating on a network Sys::Virt::Error::FROM_NETWORK Network configuration handling Sys::Virt::Error::FROM_NODEDEV Node device configuration handling Sys::Virt::Error::FROM_NONE No specific error domain. Sys::Virt::Error::FROM_OPENVZ OpenVZ virtualization driver Sys::Virt::Error::FROM_PROXY Xen proxy virtualization driver Sys::Virt::Error::FROM_QEMU QEMU virtualization driver Sys::Virt::Error::FROM_REMOTE Remote client virtualization driver Sys::Virt::Error::FROM_RPC XML-RPC handling code Sys::Virt::Error::FROM_SECURITY Security services driver Sys::Virt::Error::FROM_SEXPR SEXPR parsing code Sys::Virt::Error::FROM_STATS_LINUX Device statistics code Sys::Virt::Error::FROM_STORAGE Storage configuration handling Sys::Virt::Error::FROM_TEST Test virtualization driver Sys::Virt::Error::FROM_UML UML virtualization driver Sys::Virt::Error::FROM_XEN Xen hypervisor driver Sys::Virt::Error::FROM_XEND XenD daemon driver Sys::Virt::Error::FROM_XENSTORE XenStore driver Sys::Virt::Error::FROM_XENXM Xen XM configuration file driver Sys::Virt::Error::FROM_XEN_INOTIFY Xen Inotify events driver Sys::Virt::Error::FROM_XML Low level XML parser Sys::Virt::Error::FROM_ESX The VMWare ESX driver Sys::Virt::Error::FROM_INTERFACE The host network interface driver Sys::Virt::Error::FROM_ONE The Open Nebula driver. This constant is no longer used and retained only for backwards compatibility Sys::Virt::Error::FROM_PHYP The IBM Power Hypervisor driver Sys::Virt::Error::FROM_SECRET The secret management driver Sys::Virt::Error::FROM_VBOX The VirtualBox driver Sys::Virt::Error::FROM_AUDIT The audit driver Sys::Virt::Error::FROM_CPU The CPU information driver Sys::Virt::Error::FROM_DOMAIN_SNAPSHOT The domain snapshot driver Sys::Virt::Error::FROM_HOOK The daemon hook driver Sys::Virt::Error::FROM_NWFILTER The network filter driver Sys::Virt::Error::FROM_STREAMS The data streams driver Sys::Virt::Error::FROM_SYSINFO The system information driver Sys::Virt::Error::FROM_VMWARE The VMWare driver Sys::Virt::Error::FROM_XENAPI The XenAPI driver Sys::Virt::Error::FROM_EVENT The event driver Sys::Virt::Error::FROM_LIBXL The libxl Xen driver Sys::Virt::Error::FROM_LOCKING The lock manager drivers Sys::Virt::Error::FROM_HYPERV The Hyper-V driver Sys::Virt::Error::FROM_CAPABILITIES The capabilities driver Sys::Virt::Error::FROM_AUTH The authentication handling code Sys::Virt::Error::FROM_URI The URI handling code Sys::Virt::Error::FROM_DBUS The DBus handling code ERROR CODE CONSTANTS The error codes allow for specific problems to be identified and handled separately from generic error handling. Sys::Virt::Error::ERR_AUTH_FAILED Authentication falure when connecting to a driver Sys::Virt::Error::ERR_CALL_FAILED Operation not supported by driver (DEPRECATED & unused) Sys::Virt::Error::ERR_CONF_SYNTAX Configuration file syntax error Sys::Virt::Error::ERR_DOM_EXIST The domain already exists Sys::Virt::Error::ERR_DRIVER_FULL Too many hypervisor drivers have been registered Sys::Virt::Error::ERR_GET_FAILED HTTP GET command failed talking to XenD Sys::Virt::Error::ERR_GNUTLS_ERROR GNUTLS encryption error in RPC driver Sys::Virt::Error::ERR_HTTP_ERROR Unexpected HTTP error code from XenD Sys::Virt::Error::ERR_INTERNAL_ERROR Generic internal error Sys::Virt::Error::ERR_INVALID_ARG Invalid argument supplied to function Sys::Virt::Error::ERR_INVALID_CONN Invalid connection object Sys::Virt::Error::ERR_INVALID_DOMAIN Invalid domain object Sys::Virt::Error::ERR_INVALID_MAC Invalid MAC address string Sys::Virt::Error::ERR_INVALID_NETWORK Invalid network object Sys::Virt::Error::ERR_INVALID_NODE_DEVICE Invalid node device object Sys::Virt::Error::ERR_INVALID_STORAGE_POOL Invalid storage pool object Sys::Virt::Error::ERR_INVALID_STORAGE_VOL Invalid storage vol object Sys::Virt::Error::ERR_NETWORK_EXIST Network with this name/uuid already exists Sys::Virt::Error::ERR_NO_CONNECT Unable to connect to requested hypervisor driver Sys::Virt::Error::ERR_NO_DEVICE Missing device information Sys::Virt::Error::ERR_NO_DOMAIN No such domain with that name/uuid/id Sys::Virt::Error::ERR_NO_KERNEL Missing kernel information in domain configuration Sys::Virt::Error::ERR_NO_MEMORY Missing memory information in domain configuration Sys::Virt::Error::ERR_NO_NAME Missing name in object configuration Sys::Virt::Error::ERR_NO_NETWORK No such network with that name/uuid Sys::Virt::Error::ERR_NO_NODE_DEVICE No such node device with that name Sys::Virt::Error::ERR_NO_OS Missing OS information in domain configuration Sys::Virt::Error::ERR_NO_ROOT Missing root device information in domain configuration Sys::Virt::Error::ERR_NO_SECURITY_MODEL Missing security model information in domain configuratio Sys::Virt::Error::ERR_NO_SOURCE Missing source device information in domain configuration Sys::Virt::Error::ERR_NO_STORAGE_POOL No such storage pool with that name/uuid Sys::Virt::Error::ERR_NO_STORAGE_VOL No such storage volume with that name/path/key Sys::Virt::Error::ERR_NO_SUPPORT This operation is not supported by the active driver Sys::Virt::Error::ERR_NO_TARGET Missing target device information in domain configuration Sys::Virt::Error::ERR_NO_XEN Unable to connect to Xen hypervisor Sys::Virt::Error::ERR_NO_XENSTORE Unable to connect to XenStorage daemon Sys::Virt::Error::ERR_OK No error code. This should never be see Sys::Virt::Error::ERR_OPEN_FAILED Unable to open a configuration file Sys::Virt::Error::ERR_OPERATIONED_DENIED The operation is forbidden for the current connection Sys::Virt::Error::ERR_OPERATION_FAILED The operation failed to complete Sys::Virt::Error::ERR_OS_TYPE Missing/incorrect OS type in domain configuration Sys::Virt::Error::ERR_PARSE_FAILED Failed to parse configuration file Sys::Virt::Error::ERR_POST_FAILED HTTP POST failure talking to XenD Sys::Virt::Error::ERR_READ_FAILED Unable to read from configuration file Sys::Virt::Error::ERR_RPC Generic RPC error talking to XenD Sys::Virt::Error::ERR_SEXPR_SERIAL Failed to generic SEXPR for XenD Sys::Virt::Error::ERR_SYSTEM_ERROR Generic operating system error Sys::Virt::Error::ERR_UNKNOWN_HOST Unknown hostname Sys::Virt::Error::ERR_WRITE_FAILED Failed to write to configuration file Sys::Virt::Error::ERR_XEN_CALL Failure while talking to Xen hypervisor Sys::Virt::Error::ERR_XML_DETAIL Detailed XML parsing error Sys::Virt::Error::ERR_XML_ERROR Generic XML parsing error Sys::Virt::Error::WAR_NO_NETWORK Warning that no network driver is activated Sys::Virt::Error::WAR_NO_NODE Warning that no node device driver is activated Sys::Virt::Error::WAR_NO_STORAGE Warning that no storage driver is activated Sys::Virt::Error::ERR_INVALID_INTERFACE Invalid network interface object Sys::Virt::Error::ERR_NO_INTERFACE No interface with the matching name / mac address Sys::Virt::Error::ERR_OPERATION_INVALID The requested operation is not valid for the current object state Sys::Virt::Error::WAR_NO_INTERFACE The network interface driver is not available Sys::Virt::Error::ERR_MULTIPLE_INTERFACES There are multiple interfaces with the requested MAC address Sys::Virt::Error::ERR_BUILD_FIREWALL The firwall could not be constructed Sys::Virt::Error::WAR_NO_NWFILTER The network filter driver could not be activated Sys::Virt::Error::ERR_NO_NWFILTER There is no network filter driver available Sys::Virt::Error::ERR_INVALID_NWFILTER The network filter object was invalid Sys::Virt::Error::WAR_NO_SECRET There secret management driver is not available Sys::Virt::Error::ERR_NO_SECRET No secret with the matching uuid / usage ID Sys::Virt::Error::ERR_INVALID_SECRET Invalid secret object Sys::Virt::Error::ERR_CONFIG_UNSUPPORTED The requested XML configuration is not supported by the hypervisor Sys::Virt::Error::ERR_OPERATION_TIMEOUT The operation could not be completed in a satisfactory time Sys::Virt::Error::ERR_MIGRATE_PERSIST_FAILED Unable to persistent the domain configuration after migration successfully completed Sys::Virt::Error::ERR_HOOK_SCRIPT_FAILED Execution of a daemon hook script failed Sys::Virt::Error::ERR_INVALID_DOMAIN_SNAPSHOT The domain snapshot object pointer was invalid Sys::Virt::Error::ERR_NO_DOMAIN_SNAPSHOT No matching domain snapshot was found Sys::Virt::Error::ERR_INVALID_STREAM The stream object pointer was invalid Sys::Virt::Error::ERR_ARGUMENT_UNSUPPORTED The argument value was not supported by the driver Sys::Virt::Error::ERR_STORAGE_POOL_BUILT The storage pool has already been built Sys::Virt::Error::ERR_STORAGE_PROBE_FAILED Probing the storage pool failed Sys::Virt::Error::ERR_SNAPSHOT_REVERT_RISKY Reverting the snapshot could cause data loss Sys::Virt::Error::ERR_OPERATION_ABORTED The asynchronous operation was aborted at admin request Sys::Virt::Error::ERR_AUTH_CANCELLED The user cancelled the authentication process Sys::Virt::Error::ERR_NO_DOMAIN_METADATA The requested metadata does not exist Sys::Virt::Error::ERR_MIGRATE_UNSAFE The migration operation would be unsafe to perform Sys::Virt::Error::ERR_OVERFLOW The calculation would overflow Sys::Virt::Error::ERR_BLOCK_COPY_ACTIVE Action prevented by block copy job AUTHORS
Daniel P. Berrange <berrange@redhat.com> COPYRIGHT
Copyright (C) 2006 Red Hat Copyright (C) 2006-2007 Daniel P. Berrange LICENSE
This program is free software; you can redistribute it and/or modify it under the terms of either the GNU General Public License as published by the Free Software Foundation (either version 2 of the License, or at your option any later version), or, the Artistic License, as specified in the Perl README file. SEE ALSO
Sys::Virt::Domain, Sys::Virt, "http://libvirt.org" perl v5.14.2 2012-05-21 Sys::Virt::Error(3pm)
All times are GMT -4. The time now is 03:52 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy