awk to combine lines from line with pattern match to a line that ends in a pattern
I am trying to combine lines with these conditions:
1. First line starts with text of "libname VALUE db2 datasrc" where VALUE can be any text.
2. If condition1 is met then continue to combine lines through a line that ends with a semicolon.
3. Ignore case when matching patterns and remove any leading spaces from line when joining.
I have tried to code this using awk or sed without success.
Hi all,
I've been working on a script which I have hit a road block now. I have written a script using sed to extract the below data and pumped into another file:
Severity............: MAJORWARNING
Summary:
System temperature is out of normal range.
Severity............: MAJORWARNING... (13 Replies)
I have following pattern in a file:
00:01:38 UTC
abcd
00:01:48 UTC
00:01:58 UTC
efgh
00:02:08 UTC
00:02:18 UTC
and I need to change something like the following
00:01:38 UTC
abcd
00:01:48 UTC
XXXX
00:01:58 UTC
efgh
00:02:08 UTC
XXXX (6 Replies)
Hi,
I have got the below requirement. please suggest.
I have a file like,
Processing Item is:
/data/ing/cfg2/abc.txt
/data/ing/cfg3/bgc.txt
Processing Item is:
/data/cmd/for2/ght.txt
/data/kernal/config.klgt.txt
I want to process the above file to get the output file like,
... (5 Replies)
awk , sed Experts,
I want to remove first and last line after pattern match "vg" :
I am trying : # sed '1d;$d' works fine , but where the last line is not having vg entry it is deleting one line of data.
- So it should check for the pattern vg if present , then it should delete the line ,... (5 Replies)
Data:
Pattern Data Data Data
Data Data Data
Data Data Data
...
With awk, how do I print the pattern matching line, then the subsequent lines following the pattern matching line. Varying number of lines following the pattern matching line. (9 Replies)
Im using the command below , but thats not the output that i want. it only prints the odd and even numbers.
awk '{if(NR%2){print $0 > "1"}else{print $0 > "2"}}'
Im hoping for something like this
file1:
Text hi this is just a test
text1 text2 text3 text4 text5 text6
Text hi... (2 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)
Hi,
I have input which reads like
9089.00 ----- kl jkjjljk lkkk; (909099) 9097.00 ----- HGJJHHJ jcxkjlkjvhvlk jhdkjksdfkhfskd 898.00 ----- HHHH
I am trying to do something like this - As soon as I found pattern match "XYZ.00-----" it will insert a line break to the input and will go to... (3 Replies)
In the awk piped to sed below I am trying to format file by removing the odd xxxx_digits and whitespace after, then move the even xxxx_digit to the line above it and add a space between them. There may be multiple lines in file but they are in the same format. The Filename_ID line is the last line... (4 Replies)
FIPSCHECK(3) fipscheck FIPSCHECK(3)NAME
FIPSCHECK_verify, FIPSCHECK_verify_ex, FIPSCHECK_verify_files, FIPSCHECK_verify_files_ex, FIPSCHECK_fips_module_installed,
FIPSCHECK_get_binary_path, FIPSCHECK_get_library_path, FIPSCHECK_kernel_fips_mode, fipscheck.h - Various functions relating to running in
FIPS mode
SYNOPSIS
#include <fipscheck.h>
int FIPSCHECK_verify(const char *libname, const char *symbolname);
int FIPSCHECK_verify_ex(const char *libname, const char *symbolname, const char *hmac_suffix, int fail_if_missing);
int FIPSCHECK_verify_files(const char *files[]);
int FIPSCHECK_verify_files_ex(const char *hmac_suffix, int fail_if_missing, const char *files[]);
int FIPSCHECK_fips_module_installed(const char *libname, const char *symbolname, const char *hmac_suffix);
int FIPSCHECK_get_binary_path(char *path, size_t pathlen);
int FIPSCHECK_get_library_path(const char *libname, const char *symbolname, char *path, size_t pathlen);
int FIPSCHECK_kernel_fips_mode(void);
DESCRIPTION
The function FIPSCHECK_kernel_fips_mode() tests for the FIPS-140-2 mode in kernel.
The function FIPSCHECK_verify() computes and compares HMAC-SHA256 checksum by spawning the fipscheck command. The parameters libname and
symbolname determine which shared library file loaded into the process space will be checksummed. If these parameters are set to NULL, the
executable of the calling process is checksummed.
The function FIPSCHECK_verify_ex() in addition to the functionality above also allows to specify the full hmac_suffix with the default
value of .hmac. And will return success if the hmac file is missing and the fail_if_missing parameter is set to 0.
The function FIPSCHECK_verify_files() can be used to explicitly specify NULL terminated array of file names in the parameter files to
check.
Similarly the function FIPSCHECK_verify_files_ex() in addition to the functionality above also allows to specify the full hmac_suffix with
the default value of .hmac. And will return success if the first hmac file is missing and the fail_if_missing parameter is set to 0.
The checksum file contains the HMAC-SHA256 encoded in hexadecimal notation using lowercase letters with one EOL character appended at the
end.
The function FIPSCHECK_fips_module_installed() returns 1 if the hmac checksum file is found and 0 otherwise.
The functions FIPSCHECK_get_library_path() and FIPSCHECK_get_binary_path() return the shared library and executable paths in the path. The
buffer pointed to by the parameter must be large enough to hold the path otherwise the path is truncated. The size of the buffer is
specified by the pathlen.
RETURN VALUE
The main functions FIPSCHECK_verify() and FIPSCHECK_verify_files() return 1 when the verification of the binaries succeeds and 0 otherwise.
The function FIPSCHECK_kernel_fips_mode() returns 1 when the kernel is in fips mode and 0 otherwise.
The auxiliary functions FIPSCHECK_get_binary_path() and FIPSCHECK_get_library_path() return 0 on success and -1 if the path cannot be
determined.
FIPS MODE
A kernel compiled with CONFIG_CRYPTO_FIPS=y can be booted in fips mode by specifying fips=1 as kernel parameter. Please refer to the
security policy of the Kernel FIPS module for further details.
SEE ALSO fipscheck(8), fipshmac(8), https://fedorahosted.org/fipscheck/
AUTHOR
Tomas Mraz <tmraz@redhat.com>.
Man page authors Paul Wouters <pwouters@redhat.com> and Tomas Mraz <tmraz@redhat.com>.
COPYRIGHT
Copyright 2008, 2012 Red Hat, Inc. All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are
met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
fipscheck 16 April 2012 FIPSCHECK(3)