Print all lines between two keyword if a specific pattern exist
I have input file as below I need to check for a pattern and if it is there in file then I need to print all the lines below BEGIN and END keyword. Could you please help me how to get this in AIX using sed or awk.
Input file:
If I am looking for Amit then Output should be
If I am looking for Rahul then Output should be
If I am looking for XYZ then Output should be nothing.
From below command I am able to get all the data between two keyword but not able to grep the data.
I regularly extract lines of text from files based on the presence of a particular keyword; I place the extracted lines into another text file. This takes about 2 hours to complete using the "sort" command then Kate's find & highlight facility.
I've been reading the forum & googling and can find... (4 Replies)
I'm still beginner and maybe someone can help me.
I have this input:
the great warrior a, b, c
and what i want to know is, with awk, how can i detect the string with 'warrior' string on it and print the a, b, and c seperately, become like this :
Warrior Type
a
b
c
Im still very... (3 Replies)
Hello Experts , require help . See below output:
File inputs
------------------------------------------
Server Host = mike
id rl images allocated last updated density
vimages expiration last read <------- STATUS ------->... (4 Replies)
The intended result should be :
PDF converters
'empty line'
gpdftext and pdftotext?xml version="1.0"?>
xml:space="preserve"><note-content version="0.1" xmlns:/tomboy/link" xmlns:size="http://beatniksoftware.com/tomboy/size">PDF converters
gpdftext and pdftotext</note-content>... (9 Replies)
I have multi line input(var1) and reference(var2) variables.
How to capture lines not present in var2 but present in var1?
How to capture lines present var2 but not in var1?
# configuration from server
var1="""
Custom JAX-RS
Custom Shared
Web 2.0
"""
# required configuration... (6 Replies)
Hi, I need to print lines which are matching with start pattern "SELECT" and END PATTERN ";" and only select the last "select" statement including the ";" .
I have attached sample input file and the desired input should be as:
INPUT FORMAT:
SELECT
ABCD,
DEFGH,
DFGHJ,
JKLMN,
AXCVB,... (5 Replies)
Discussion started by: nani2019
5 Replies
LEARN ABOUT DEBIAN
pkcs7
PKCS7(1SSL) OpenSSL PKCS7(1SSL)NAME
pkcs7 - PKCS#7 utility
SYNOPSIS
openssl pkcs7 [-inform PEM|DER] [-outform PEM|DER] [-in filename] [-out filename] [-print_certs] [-text] [-noout] [-engine id]
DESCRIPTION
The pkcs7 command processes PKCS#7 files in DER or PEM format.
COMMAND OPTIONS -inform DER|PEM
This specifies the input format. DER format is DER encoded PKCS#7 v1.5 structure.PEM (the default) is a base64 encoded version of the
DER form with header and footer lines.
-outform DER|PEM
This specifies the output format, the options have the same meaning as the -inform option.
-in filename
This specifies the input filename to read from or standard input if this option is not specified.
-out filename
specifies the output filename to write to or standard output by default.
-print_certs
prints out any certificates or CRLs contained in the file. They are preceded by their subject and issuer names in one line format.
-text
prints out certificates details in full rather than just subject and issuer names.
-noout
don't output the encoded version of the PKCS#7 structure (or certificates is -print_certs is set).
-engine id
specifying an engine (by its unique id string) will cause pkcs7 to attempt to obtain a functional reference to the specified engine,
thus initialising it if needed. The engine will then be set as the default for all available algorithms.
EXAMPLES
Convert a PKCS#7 file from PEM to DER:
openssl pkcs7 -in file.pem -outform DER -out file.der
Output all certificates in a file:
openssl pkcs7 -in file.pem -print_certs -out certs.pem
NOTES
The PEM PKCS#7 format uses the header and footer lines:
-----BEGIN PKCS7-----
-----END PKCS7-----
For compatibility with some CAs it will also accept:
-----BEGIN CERTIFICATE-----
-----END CERTIFICATE-----
RESTRICTIONS
There is no option to print out all the fields of a PKCS#7 file.
This PKCS#7 routines only understand PKCS#7 v 1.5 as specified in RFC2315 they cannot currently parse, for example, the new CMS as
described in RFC2630.
SEE ALSO crl2pkcs7(1)1.0.1e 2013-02-11 PKCS7(1SSL)