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
CFDPCLOCK(1)							 CFDP executables						      CFDPCLOCK(1)

NAME
cfdpclock - CFDP daemon task for managing scheduled events SYNOPSIS
cfdpclock DESCRIPTION
cfdpclock is a background "daemon" task that periodically performs scheduled CFDP activities. It is spawned automatically by cfdpadmin in response to the 's' command that starts operation of the CFDP protocol, and it is terminated by cfdpadmin in response to an 'x' (STOP) command. Once per second, cfdpclock takes the following action: First it scans all inbound file delivery units (FDUs). For each one whose check timeout deadline has passed, it increments the check timeout count and resets the check timeout deadline. For each one whose check timeout count exceeds the limit configured for this node, it invokes the Check Limit Reached fault handling procedure. Then it scans all outbound FDUs. For each one that has been Canceled, it cancels all extant PDU bundles and sets transmission progress to the size of the file, simulating the completion of transmission. It destroys each outbound FDU whose transmission is completed. EXIT STATUS
0 cfdpclock terminated, for reasons noted in the ion.log file. If this termination was not commanded, investigate and solve the problem identified in the log file and use cfdpadmin to restart cfdpclock. 1 cfdpclock was unable to attach to CFDP protocol operations, probably because cfdpadmin has not yet been run. FILES
No configuration files are needed. ENVIRONMENT
No environment variables apply. DIAGNOSTICS
The following diagnostics may be issued to the ion.log log file: cfdpclock can't initialize CFDP. cfdpadmin has not yet initialized CFDP protocol operations. Can't dispatch events. An unrecoverable database error was encountered. cfdpclock terminates. Can't manage links. An unrecoverable database error was encountered. cfdpclock terminates. BUGS
Report bugs to <ion-bugs@korgano.eecs.ohiou.edu> SEE ALSO
cfdpadmin(1) perl v5.14.2 2012-05-25 CFDPCLOCK(1)
All times are GMT -4. The time now is 05:10 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy