Sponsored Content
Full Discussion: Counting Errors
Top Forums Shell Programming and Scripting Counting Errors Post 302266786 by jim mcnamara on Thursday 11th of December 2008 04:05:30 AM
Old 12-11-2008
I'm using cat to read the errcnt file, you can use process substitution if you are using bash -
Code:
if [[ -w /path/to/errcnt ]] ; then
     cat /path/to/errcnt | read errcnt
else
     echo "0" > /path/to/errcnt
fi
grep -c 'ERROR' a.log | read newerrcnt dummy
if [[ $newerrcnt -gt $errcnt ]] ; then
       echo "New errors found"
        echo $newerrcnt" > /path/to/errcnt
else
       echo "okay no more errors found"
fi

 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Adapter Errors and Link Errors

$ errpt | more IDENTIFIER TIMESTAMP T C RESOURCE_NAME DESCRIPTION 3074FEB7 0802050205 T H fscsi1 ADAPTER ERROR B8113DD1 0802050205 T H fcs1 LINK ERROR B8113DD1 0802050205 T H fcs1 LINK ERROR 3074FEB7 0802050205 T H fscsi0 ADAPTER ERROR B8113DD1 ... (0 Replies)
Discussion started by: mcastill66
0 Replies

2. AIX

Adapter Errors and Link Errors

$ errpt | more IDENTIFIER TIMESTAMP T C RESOURCE_NAME DESCRIPTION 3074FEB7 0802050205 T H fscsi1 ADAPTER ERROR B8113DD1 0802050205 T H fcs1 LINK ERROR B8113DD1 0802050205 T H fcs1 LINK ERROR 3074FEB7 0802050205 T H fscsi0 ADAPTER ERROR B8113DD1 ... (2 Replies)
Discussion started by: mcastill66
2 Replies

3. UNIX for Dummies Questions & Answers

Major OS errors/Bash errors help!!!!

Hi all, dummy here.... I have major errors on entering the shell. On login I get: -bash: dircolors: command not found -bash: tr: command not found -bash: fgrep: command not found -bash: grep: command not found -bash: grep: command not found -bash: id: command not found -bash: [: =: unary... (12 Replies)
Discussion started by: wcmmlynn
12 Replies

4. Shell Programming and Scripting

Counting with Awk

I need "awk solution" for simple counting! File looks like: STUDENT GRADE student1 A student2 A student3 B student4 A student5 B Desired Output: GRADE No.of Students A 3 B 2 Thanks for awking! (4 Replies)
Discussion started by: saint2006
4 Replies

5. Shell Programming and Scripting

counting users?

Is it possible to count the number of users? or specifically emac users? I know that you can count certain file sizes, like find /usr/bin/ -size 11k -exec ls {} \;|wc -1 but how would I count users? (3 Replies)
Discussion started by: gordonheimer
3 Replies

6. Shell Programming and Scripting

Counting

Hi, I want to count how many rows are in a file for a specific column. eg. K NM K NM K NM K JK K NM K JK K NM so the file is tab-delimited. I want to count how many rows are in column 2 and how many NMs there are. I used awk awk '{OFS="\t"}; {count++} {print i,... (3 Replies)
Discussion started by: phil_heath
3 Replies

7. UNIX for Dummies Questions & Answers

counting words

if i have a long list of data, with every line beginning with an ip-address, like this: 62.165.8.187 - - "GET /bestandnaam.html HTTP/1.1" 200 5848 "http://www.domeinnaam.nl/bestandnaam.html" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)" how do i count which ip-adresses are mentioned... (3 Replies)
Discussion started by: FOBoy
3 Replies

8. Shell Programming and Scripting

Counting

Hi, The following output shows how many pmon process are started by users named : oracle or yoavb $ ps -ef |grep pmon |grep -v grep |grep -v ipmon oracle 11268 1 0 Sep 2 ? 36:00 ora_pmon_qerp oracle 17496 1 0 Oct 11 ? 8:58 ora_pmon_bcv oracle 15081 1 0 ... (5 Replies)
Discussion started by: yoavbe
5 Replies

9. Shell Programming and Scripting

counting using awk

Hi, I want to perform a task using shell script. I am new to awk programming and any help would be greatly appreciated. I have the following 3 files (for example) file1: Name count Symbol chr1_1_50 10 XXXX chr3_101_150 30 YYYY File2: Name ... (13 Replies)
Discussion started by: Diya123
13 Replies

10. UNIX for Dummies Questions & Answers

counting?

Hi all, I promise this is my very last dumb question.. but how to you count how many unique names you have. My dataset is: >Bac1 afdsgrr >Bac4 egege >Bac8 dgrjh >Bac1 afdsgrr >Bac1 afdsgrr >Bac8 dgrjh What i want to know is that how many unique names there is, so the output would... (3 Replies)
Discussion started by: Iifa
3 Replies
EDAC-UTIL(1)						   EDAC error reporting utility 					      EDAC-UTIL(1)

NAME
edac-util - EDAC error reporting utility. SYNOPSIS
edac-util [OPTION]... DESCRIPTION
The edac-util program reads information from EDAC (Error Detection and Correction) drivers in the kernel, using files exported by these drivers in sysfs. With no options, edac-util will report any uncorrected error (UE) or corrected error (CE) information recorded by EDAC, along with any DIMM label information registered with EDAC. OPTIONS
-h, --help Display a summary of the command-line options. -q, --quiet Quiet mode. For some reports, edac-util will report corrected and uncorrected error counts for all MC, csrow, and channel combina- tions, even if the current count of errors is zero. The --quiet flag will suppress the display of any locations with zero errors, thus creating a more terse report. No output will be generated if there are zero total errors currently recorded by EDAC. Addition- ally, the use of --quiet will suppress all informational and debug messages, displaying only fatal errors. -v, --verbose Increase verbosity. Multiple -v's may be used. -s, --status Displays the current status of EDAC drivers. edac-util will report whether it detects that EDAC drivers are loaded, and the number of memory controllers (MCs) found in sysfs. In verbose mode, the MC id and name of each controller will also be printed. -r, --report=report,... Specify the report to generate. Currently, the available reports are default, simple, full, ue, and ce. These reports are detailed in the EDAC REPORTS section below. More than one report may be specified in a comma-separated list. EDAC REPORTS
default The default edac-util report is generated when the program is run without any options. If there are no errors logged by EDAC, this report will display "No errors to report." to stdout. Otherwise, error counts for each MC, csrow, channel combination with attrib- uted errors are displayed, along with corresponding DIMM labels, if these labels have been registered in sysfs. The default report will also display any errors that do not have any DIMM information. These errors occur when errors are reported in the memory controller overflow register, indicating that more than one error occurred during a given EDAC poll cycle. It is usu- ally obvious from which DIMM locations these errors were generated. simple The simple report reports total corrected and uncorrected errors for each MC detected on the system. It also displays a tally of total errors. With the --quiet option, only non-zero error counts are displayed. full The full report generates a line of output for every MC, csrow, channel combination found in EDAC sysfs. This includes counts of errors with no information ("noinfo" errors). Output is of the form: MC:(csrow|noinfo):(label|all):(UE|CE):count With the --quiet option, only non-zero error counts will be displayed. ue This report simply displays the total number of Uncorrected Errors (UEs) detected on the system. With the --quiet option, output will be suppressed unless there are 1 or more errors to report. ce This report simply displays the total number of Corrected Errors (CEs) detected on the system. With the --quiet option, output will be suppressed unless there are 1 or more errors to report. SEE ALSO
edac(3), edac-ctl(8) edac-utils-0.18-1 2011-11-09 EDAC-UTIL(1)
All times are GMT -4. The time now is 11:31 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy