Sponsored Content
Top Forums Shell Programming and Scripting Optimizing for loop with awk or anything similar and portable Post 302978184 by SkySmart on Wednesday 27th of July 2016 08:18:51 AM
Old 07-27-2016
Quote:
Originally Posted by RudiC
Do I get it right that both WARNING and CRITICAL are always 1 in all cases in STRING1? And, what is that _P_ prefix for?
oh sorry. the _P_ represents the pipe symbol "|". It is turned to "|" at a much earlier part of the script. the warning and critical thresholds can be different. its just, in this instance, they're the same. but warning can be 1, Critical can be 2. the numbers varies.

---------- Post updated at 07:18 AM ---------- Previous update was at 07:12 AM ----------

Quote:
Originally Posted by pilnet101
Can you also post the expected output please?
the expected output should be:

Code:
OK-LGRBT:Error_posting_message__to__EMR__Queue=0
OK-LGRBT:Error_parsing_ReceiptSummary=0
CRITICAL-LGRBT:xinetd_=4327
OK-LGRBT:HTTP_1_1_500_=0
CRITICAL-LGRBT:START_=2164
OK-LGRBT:Marshaller_exception_while__converting_to_Receipt_xml=0
OK-LGRBT:MessagePublisher_is_not_configured_correctly=0
OK-LGRBT:Error_populating_JAXB_Object=0
CRITICAL-LGRBT:collectd_=42

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

how to get the similar function in while loop or for loop

Dear all How to write the shell script for the following statement: (C programming) for (i=0;i<30;i++) { if i=1 continue *skip this number (To do function here....) ... } similar statement in while loop.... I wrote the script in sh... (3 Replies)
Discussion started by: trynew
3 Replies

2. Shell Programming and Scripting

awk - Counting number of similar lines

Hi All I have the input file OMAK_11. OMAK 000002EXCLUDE 1341 OMAK 000002EXCLUDE 1341 OMAK 000002EXCLUDE 1341 OMAK 000003EXCLUDE 1341 OMAK 000003EXCLUDE 1341 OMAK 000003EXCLUDE ... (8 Replies)
Discussion started by: dhanamurthy
8 Replies

3. Shell Programming and Scripting

awk, sed or similar log repair help

I have a log file that for some reason, once or two time a month, line foods are missing. This log is generated from vmstat everyminute. I dont know why sometimes it does this. Each line in the log should have 18 columns separated by one or more spaces. Good Log: (not actual log) 1 1... (8 Replies)
Discussion started by: Ikon
8 Replies

4. Shell Programming and Scripting

Help in grep function or similar using awk

I have a list of id; for example: file 1 dfghd dfghe dfgey dfgeu I have another data file that contain this ids as headers; for ex. file2 >dfghd gfdgfddl;klfkld;ld;lgl;dld'l'dv >dfghe gkwhjhsgdjdjdjhjddj >dfgey jdkjfhdjhfdkjhfdkhkdk I wanted to compare file 1 and file 2... (1 Reply)
Discussion started by: Lucky Ali
1 Replies

5. Shell Programming and Scripting

Help with awk or something similar

i have a file like this: wedd01A1 1 wedd01A2 2 wedd01A3 1 wedd02A2 3 wedd02A3 4 wadd02A1 1 wadd02A2 5 wqdd01A1 3 wsdd01A3 1 i want out like this: A1 A2 A3 wedd01 1 2 1 wedd02 0 3 4 wadd02 1 5 0 wqdd01 3 0 0 wsdd01 0 0 1 (8 Replies)
Discussion started by: aydj
8 Replies

6. Shell Programming and Scripting

Merging two columns from two files with similar names into a loop

I have two files like this: fileA.net A B C fileA.dat 1 2 3 and I want the output output_expected A 1 B 2 C 3 I know that the easier way is to do a paste fileA.net fileA.dat, but the problem is that I have 10,000 couple of files (fileB.net with fileB.dat; fileC.net with... (3 Replies)
Discussion started by: valente
3 Replies

7. Shell Programming and Scripting

Optimizing awk script

Can this awk statement be optimized? i ask because log.txt is a giant file with several hundred thousands of lines of records. myscript.sh: while read line do searchterm="${1}" datecurr=$(date +%s) file=$(awk 'BEGIN{split(ARGV,var,",");print var}' $line) ... (3 Replies)
Discussion started by: SkySmart
3 Replies

8. Shell Programming and Scripting

Add values of similar patterns with awk

so my output is this: session_closed=157 session_opened=151 session_closed=18 session_opened=17 there are two patterns here, but with different values. the two patterns are "session_opened" and "session_closed". i expect there will be many more other patterns. what i want to do is... (8 Replies)
Discussion started by: SkySmart
8 Replies

9. Shell Programming and Scripting

Vlookup using awk non similar files

I need to vlookup and check the server not found. Source file 1 server1 server2 server3 server4 server5_root server6_silver server7 server7-test server7-temp Source file 2 server1_bronze (6 Replies)
Discussion started by: ranjancom2000
6 Replies

10. Shell Programming and Scripting

Optimizing bash loop

now, i have to search for a pattern within a particular time frame which the user will provide in the following format: 19/Jun/2018:07:04,21/Jun/2018:21:30 it is easy to get tempted to attempt this search with a variation of the following awk command: awk... (3 Replies)
Discussion started by: SkySmart
3 Replies
APT-CUDF-GET(8) 						    DOSE Tools							   APT-CUDF-GET(8)

NAME
apt-cudf-get - wrapper for calling apt-get with external solvers SYNOPSIS
apt-cudf-get [arguments] DESCRIPTION
apt-cudf-get is a wrapper that allows to invoke apt-get with external solvers while ignoring apt's pinning. All options are passed on to apt-get. Normally, apt uses so-called pinning to select a candidate version of a package in case there are several versions available. This also holds when calling apt-get with external solvers. However, when it is not possible to find a solution under this constraint, it may be useful to relax pinning and to allow the external solver to choose among all available versions of packages in order to satisfy dependencies, not only those that are selected by the pinning. This is precisely what apt-cudf-get does. Note that, when using an external solver, the proposed solution may contain any available version of the packages that are given as arguments to install on the command line without specifying a version qualifier. For example apt-cudf-get --solver aspcud install ocaml may propose to install any available version of ocaml, while apt-cudf-get --solver aspcud install ocaml=4.01.0 will only propose to install ocaml in version 4.01.0 AUTHOR
Pietro Abate and Roberto Di Cosmo BUGS
Not all types of arguements to apt are correctly treated by this wrapper, in particular not the +pkg and -pkg shorthands for installation and removal requests. SEE ALSO
apt-get(8), apt-cudf(1), apt-cudf.conf(5), update-cudf-solvers(8), README.cudf-solvers <file:///usr/share/doc/apt-cudf/README.cudf-solvers>, README.Debian <file:///usr/share/doc/apt-cudf/README.Debian> dose3 3.0.2 2012-06-25 APT-CUDF-GET(8)
All times are GMT -4. The time now is 09:53 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy