Sponsored Content
Top Forums UNIX for Beginners Questions & Answers How to 'improve' this script and also 'fix' the pattern matching part? Post 303040350 by RudiC on Sunday 27th of October 2019 03:52:58 AM
Old 10-27-2019
Try
Code:
awk '
/^ *Fatal/,/^ *Client/  {if (/Time/) printf "^%s", $0
                         if (/Client/)  {printf "^%s", $0
                                         getline
                                         if (/WARNING/) printf "^%s\n", $0
                                         else printf "^No Warning encountered\n"
                                        }
                        }
' file

Doesn't help if the log is messed up with e.g. two events being logged one on top of the other.
This User Gave Thanks to RudiC For This Post:
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

vi part-pattern matching and deletion

Hi, I have a log file which shows the files which has been changed over the last week. They follow this pattern: old_file_version_number@@new_file_version_number Now I need to know how to delete from each line parts starting from @@. I would be issuing the command inside vi(m). So... (5 Replies)
Discussion started by: vino
5 Replies

2. Shell Programming and Scripting

bash script, pattern matching + sum

Hi guys, i have been struggling to achieve the following and therefor looking for some help. I am trying to write something that will summerize the following output from my switches for daily totals. Basicly if $1 $2 $3 doesnt change, we can keep adding up $4. Probably would use a awk print end... (3 Replies)
Discussion started by: Wratholix
3 Replies

3. Shell Programming and Scripting

Pattern matching in a shell script?

I'm looking for a way to match a particular string in another string and if a match is found execute some command. I found the case statement can be used like this; case word in ) command ;; ] ... esac If my string to find is say "foo" in the string $mystring... (1 Reply)
Discussion started by: paulobrad
1 Replies

4. Shell Programming and Scripting

Problem extracting just a part of a matching pattern

Hello everyone, this is my first post so please give me a hand. I apologize for my English, I'll try to be clear with my request. I need to write a script (Bash) which finds all the variables defined in the file .h of the folder and then writes the name of the files .c where these variables are... (1 Reply)
Discussion started by: paxilpaz
1 Replies

5. Shell Programming and Scripting

shell script pattern matching

Hi, I need to create a shell script through which i need to populate email addresses in email columns of database table in mysql. Let say if email contains yahoo, hotmail, gtalk than email addresses need to move in their respective columns. # !/bin/sh yim="example@yahoo.com"... (3 Replies)
Discussion started by: mirfan
3 Replies

6. Shell Programming and Scripting

Pattern matching in shell script

Hi, I am using following command to extract string from a file. String will be after last / (slash). awk -F\ / '{print $NF}' $FILE but while appending the output in file in script, it dosent work. File created but of zero size... can anyone please help `awk -F\\\/ '{print $NF}' $FILE` >... (3 Replies)
Discussion started by: Deei
3 Replies

7. UNIX for Dummies Questions & Answers

Script to list non matching files using pattern

Hi, I am trying to write a script that list down all the files that do not match the pattern My pattern will be like this "*.jpg|*.xml|*.sql". This pattern will be stored in a file. The script need to read this pattern from the file and delete the files that does not match this pattern. It... (7 Replies)
Discussion started by: meenavin
7 Replies

8. Shell Programming and Scripting

Expect Script - Pattern Matching Trouble

I am still learning expect, For the below script I always get This is True as the answer. Tried to debug and does not make sense to me. Not sure, where I am doing the mistake. Need Help! - Thanks #!/usr/bin/expect -f set timeout 10 spawn -noecho bash expect { *$* } send "test -d... (3 Replies)
Discussion started by: rmsagar
3 Replies

9. Shell Programming and Scripting

Pattern Matching in Perl script

I have a big perl script need to fix a small pattern matching inside .. I have patterns like create unique index create index The pattern matching should look for both the pattern in the same statement, The existing matching looks for only "create unique index" The exising code for this i... (6 Replies)
Discussion started by: greenworld123
6 Replies

10. Shell Programming and Scripting

Taking out part of a string by matching a pattern

Hi All, My Problem is like below. I have a file which contains just one row and contains data like PO_CREATE12457888888888889SK1234567878744551111111111SK89456321145789955455555SK8888888815788852222 i want to extract SK12345678 SK89456321 SK88888888 So basically SK and next 8... (4 Replies)
Discussion started by: Asfakul Islam
4 Replies
FC-MATCH(1)															       FC-MATCH(1)

NAME
fc-match - match available fonts SYNOPSIS
fc-match [ -svV? ] [ --sort ] [ --verbose ] [ --version ] [ --help ] [ font-pattern ] DESCRIPTION
fc-match matches font-pattern (empty pattern by default) using the normal fontconfig matching rules to find the best font available. If --sort is given, the sorted list of best matching fonts is displayed. With --verbose, the whole font pattern for each match is printed, otherwise only the file, family and style are printed.. OPTIONS
This program follows the usual GNU command line syntax, with long options starting with two dashes (`-'). A summary of options is included below. -v --verbose Print whole font pattern for each match. -? --help Show summary of options. -V --version Show version of the program and exit. -s --sort Displays sorted list of best matching fonts. font-pattern Displays fonts matching font-pattern (uses empty pattern by default). SEE ALSO
fc-list (1). The fontconfig user's guide, in HTML format: /usr/share/doc/packages/fontconfig/fontconfig-user.html. AUTHOR
This manual page was updated by Patrick Lam <plam@csail.mit.edu>. 16 October 2006 FC-MATCH(1)
All times are GMT -4. The time now is 05:52 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy