Need grep regex to extract multiline text between two strings
I have a file conatining the below:
I have a start pattern in variable myip="10.9.14.126"
The end pattern should ONLY be the colon [:] for the next IP / Host i.e the bold part here 10.9.16.16: or the end patter should be "EOF" (end of file) incase there is no Semicolon as the entry was the last antry the last IP in the file.
I have a file like: myfile.txt
it is easy to learn awk and begin awk scripting
and awk has got many features
awk is a powerful text processing tool
Now i want to get the text between first awk and immediate awk not the third awk . How to get it ? its urgent pls help me and file is unevenly... (2 Replies)
Hi,
I have a file from which i need to extract data between two constant strings.
The data looks like this :
Line 1 SUN> read db @cmpd unit 60
Line 2 Parameter: CMPD -> "C00071"
Line 3
Line 4 SUN> generate
Line 5 tabint>ERROR: (Variable data)
The data i need to extract is... (11 Replies)
Hi,
I am a newbie to shell scripting and to Linux environment as well.
In my project I am trying to search for following text from the httpd.conf file
<Directory '/somedir/someinnerdir'>
AllowOverride All
</Directory>
and then remove this text and again rewrite the same text.
The... (1 Reply)
Hi,
I'm trying to retrieve text between two strings excluding the two strings.
So for example I have the following input:
type=friend
username=phone1
secret=password
host=dynamic
dtmfmode=rfc2833
mailbox=9664
context=sip
insecure=very
canreinvite=no
nat=yes
realm=192.168.1.122... (3 Replies)
I have a text wich looks like this:
clid=2 cid=6 client_database_id=35 client_nickname=Peter client_type=0|clid=3 cid=22 client_database_id=57 client_nickname=Paul client_type=0|clid=5 cid=22 client_database_id=7 client_nickname=Mary client_type=0|clid=6 cid=22 client_database_id=6... (3 Replies)
Hi,
I want to extract some text between two strings in a line i am using following command i.e;
awk '/-string1/,/-string2/' filename
contents of file is---
line1
line2
aaa -bbb -ccc -string1 c,d,e -string2
line4
but it is showing complete line which is having searched strings.
aaa... (19 Replies)
Hi I have something like this:
EXAMPLE 1
CREATE UNIQUE INDEX "STRING_1"."STRING_2" ON "BOSNI_CAB_EVENTO"
("CD_EVENTO" , "CD_EJECUCION" ) PCTFREE 10 INITRANS 2 MAXTRANS 255
STORAGE(INITIAL 5242880 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
TABLESPACE "DB1000_INDICES_512K"... (4 Replies)
Hi,
I have a text like these:
ECHO "BEGGINING THE SHELL....."
MV FILE1 > FILE2
UNIQ_ID=${1}
PARTITION_1=`${PL}/Q${CON}.KSH "SELECT ....."
PARTITION_2=`${PL}/Q${CON}.KSH "SELECT ........"
${PL}/Q${CON}.KSH "CREATE ...."
IF ....
.......
I would like to extract only text that only... (4 Replies)
Here is my sample file data:
My requirement is to have a regex expression that is able to search for visible starting string "SSLInsecureRenegotiation Off" between strings "<VirtualHost " and "</VirtualHost>".
In the sample data two lines should be matched.
Below is what I tried but... (5 Replies)
Discussion started by: mohtashims
5 Replies
LEARN ABOUT REDHAT
inncheck
INNCHECK(8) System Manager's Manual INNCHECK(8)NAME
inncheck - check inn configuration and database files.
SYNOPSIS
inncheck [ -a ] [ -v ] [ -pedantic ] [ -f ] [ -perm ] [ -noperm ] [ file=value | file ]
DESCRIPTION
Inncheck examines various configuration files and databases and verifies things about them. Things verified depend on the file being
checked, but generally are things like permissions, ownership, syntax errors in config files etc.
Inncheck does not make changes to any files -- it just reports what it thinks may be wrong, and it is up to the operator to fix the prob-
lem.
The set of files checked may be restricted by using file or file=value arguments. For example, putting incoming.conf causes only the incom-
ing.conf(5) file to be checked. Using incoming.conf=/tmp/incoming.conf on the command line will cause inncheck to only verify the incom-
ing.conf file, and it will perform the checks on the file /tmp/incoming.conf file instead of the default one.
Valid values for file are:
active
control.ctl
expire.ctl
incoming.conf
inn.conf
moderators
newsfeeds
overview.fmt
nntpsend.ctl
passwd.nntp
OPTIONS -a If any ``file'' value or ``file=value'' pairs (see below) are given, then normally only the files they refer to are checked. Use the
``-a'' flag to specify that all files should be checked regardless. In this case the form file=value will be the more useful.
-v Use the ``-v'' option to get more verbose output.
-pedantic
Use the ``-pedantic'' option to get reports on things that are not necessarily wrong, but may indicate a bad configuration -- such
as inn.conf(5) missing a key.
-f Use the ``-f'' flag to have inncheck print the appropriate chown/chgrp/chmod command necessary to fix a problem that it reports.
Any other output lines will be prefixed with a ``#'' character to make the output be valid input for a shell. Note that the
``-perm'' flag must be used as well when using this flag.
-perm Inncheck checks all files for permission problems. If the ``-perm'' flag is used, then only the files specified by the file or
file=value command line arguments will be checked for problems other than permission problems.
-noperm
To avoid doing any checking of file permissions or ownership, use the ``-noperm'' option.
EXAMPLES
To have inncheck check all files for syntax and permission problems simply:
inncheck
To have inncheck check all files for permission problems and to verify the syntax of the active and incoming.conf files do:
inncheck -perm active incoming.conf
To have inncheck check the test newsfeeds file in /var/tmp/newsfeeds.testing, do:
inncheck newsfeeds=/var/tmp/newsfeeds.testing
To have inncheck check all the files as it normally does, but to specify a different location for the newsfeeds file, so:
inncheck -a newsfeeds=/var/tmp/newsfeeds.testing
BUGS
If the ``-f'' and ``-perm'' options are used together, along with ``-a'' or some ``file'' or ``file=value'' arguments that refer to a file
with a syntax problem, then the output will no longer be valid input for a shell.
HISTORY
Written by Brendan Kehoe <brendan@cygnus.com> and Rich Salz <rsalz@uunet.uu.net> This is revision 1.5, dated 1998/10/30.
SEE ALSO active(5), expire.ctl(5), history(5), incoming.conf(5), inn.conf(5), newsfeeds(5)INNCHECK(8)