01-25-2018
Hi Scott your post was very useful. Also can you please advice whether by using UNIX command we can match a certain pattern and return the following lines which is user-defined. By User-defined, I mean the text file will be in a format so as to match a file pattern and return another part of the file by ignoring few lines.
In the above mentioned example, I want to find the text UNIX and just return below
Test 8
Test 9
It will be great if the result is copied to a new text file.
Thanks in advance
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I've got a file with the following layout:
#STMP FSgroup
filename /filesysname1
filestatus 2
#STMP FSstatus
filename /filesysname1
ratio 30
#STMP FSgroup
filename ... (2 Replies)
Discussion started by: paulsew
2 Replies
2. Shell Programming and Scripting
Hi
I have a file which consists of a number in the square brackets, followed by the blank line, then several lines which describe this number. This pattern is repeated several thousands time. The number in the brackets and the decription of it is unique. For example:
ASRVSERV=1241GD;... (2 Replies)
Discussion started by: aoussenko
2 Replies
3. Shell Programming and Scripting
My data is something like as shown below. Out of this i want the details of alarms (ex: 1947147711,1947147081......) and the fields( ex :sw=tacmwafabb9:shelf=1:slot=5-2:pport=2)
Once i have these details separated, i want the count of these excluding the duplicates. What is the best possible way... (7 Replies)
Discussion started by: rdhanek
7 Replies
4. Shell Programming and Scripting
My data is something like shown below.
date1 date2 aaa bbbb ccccc
date3 date4 dddd eeeeeee ffffffffff ggggg hh
I want the output like this
date1date2 aaa eeeeee
I serached in the forum but didn't find the exact matching solution. Please help. (7 Replies)
Discussion started by: rdhanek
7 Replies
5. Shell Programming and Scripting
Hi Guys,
I am trying to write a perl script to search a string "Name" in the file "FILE" and also want to create a new file and push the searched string Name line along with 10 lines following the same.
can anyone of you please let me know how to go about it ? (8 Replies)
Discussion started by: sukrish
8 Replies
6. UNIX for Dummies Questions & Answers
File name : Sample.txt
Actually i would like to read <schema>Oracle<schema> string from input file and return only once database as my output.
Please advise me.
Moved to appropriate forum. (1 Reply)
Discussion started by: balajikalai
1 Replies
7. Shell Programming and Scripting
Please share the doc asap as very urgently required. (1 Reply)
Discussion started by: 24ajay
1 Replies
8. Shell Programming and Scripting
Hi guys,
I have a text file named file1.txt that is formatted like this:
001 , ID , 20000
002 , Name , Brandon
003 , Phone_Number , 616-234-1999
004 , SSNumber , 234-23-234
005 , Model , Toyota
007 , Engine ,V8
008 , GPS , OFF
and I have file2.txt formatted like this:
... (2 Replies)
Discussion started by: An0mander
2 Replies
9. UNIX for Beginners Questions & Answers
Hi Everyone,
I am looking for awk command to retrieve only the record number 23 and record number 89 from a unix file? Please let me know what is the awk command for this?
Regards
Rakesh (1 Reply)
Discussion started by: rakeshp
1 Replies
10. Homework & Coursework Questions
Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
1. The problem statement, all variables and given/known data:
I am looking for awk command to retrieve only the record number 23 and record number 89 from a unix file?... (6 Replies)
Discussion started by: rakeshp
6 Replies
LEARN ABOUT DEBIAN
qsexec
QSEXEC(1) qsexec man page QSEXEC(1)
NAME
qsexec - parses the data received via stdin and executes the defined command on a pattern match.
SYNOPSIS
qsexec -e <pattern> [-t <number>:<sec>] [-c <pattern> [<command string>]] [-p] [-u <user>] <command string>
DESCRIPTION
qsexec reads log lines from stdin and searches for the defined pattern. It executes the defined command string on pattern match.
OPTIONS
-e <pattern>
Specifes the search pattern causing an event which shall trigger the command.
-t <number>:<sec>
Defines the number of pattern match within the the defined number of seconds in order to trigger the command execution. By default,
every pattern match causes a command execution.
-c <pattern> [<command string>]
Pattern which clears the event counter. Executes optionally a command if an event command has been executed before.
-p Writes data also to stdout (for piped logging).
-u <name>
Become another user, e.g. www-data.
<command string>
Defines the event command string where $0-$9 are substituted by the submatches of the regular expression.
EXAMPLE
Executes the deny.sh script providing the IP address of the client causing a mod_qos(031) messages whenever the log message appears 10
times within at most one minute:
ErrorLog "|qsexec -e 'mod_qos(031).*, c=([0-9.]*)' -t 10:60 '/bin/deny.sh $1'"
SEE ALSO
qsfilter2(1), qsgeo(1), qsgrep(1), qslog(1), qslogger(1), qspng(1), qsrotate(1), qssign(1), qstail(1)
AUTHOR
Pascal Buchbinder, http://opensource.adnovum.ch/mod_qos/
mod_qos utilities 10.8 June 2012 QSEXEC(1)