Sponsored Content
Full Discussion: Help me in finding logic
Top Forums UNIX for Dummies Questions & Answers Help me in finding logic Post 302304513 by jim mcnamara on Monday 6th of April 2009 03:51:55 PM
Old 04-06-2009
assuming the awk works .... I fixed a few errors may have missed one.

Code:
while true 
do
  tail -n 1000 /logs/Trace.log | awk '  BEGIN{Jms = 0; OOM = 0}
    {
      /TimeOutException/{Jms++}
      /OutOfMemoryException/{OOM++}
    }
    END{printf ("jms= %-10s OOM= %-10s",Jms,OOM;)}' > somefile
   if [[ -s somefile ]] ; then 
      cat somefile | /usr/bin/mailx -s 'errors'  somebody@somewhere.com 
   fi
# 10 minutes wait
   sleep 600
done

 

We Also Found This Discussion For You

1. Shell Programming and Scripting

finding duplicate files by size and finding pattern matching and its count

Hi, I have a challenging task,in which i have to find the duplicate files by its name and size,then i need to take anyone of the file.Then i need to open the file and find for more than one pattern and count of that pattern. Note:These are the samples of two files,but i can have more... (2 Replies)
Discussion started by: jerome Sukumar
2 Replies
PHP_CHECK_SYNTAX(3)							 1						       PHP_CHECK_SYNTAX(3)

php_check_syntax - Check the PHP syntax of (and execute) the specified file

SYNOPSIS
bool php_check_syntax (string $filename, [string &$error_message]) DESCRIPTION
Performs a syntax (lint) check on the specified $filename testing for scripting errors. This is similar to using php -l from the commandline except that this function will execute (but not output) the checked $filename. For example, if a function is defined in $filename, this defined function will be available to the file that executed php_check_syntax(3), but output from $filename will be suppressed. Note For technical reasons, this function is deprecated and removed from PHP. Instead, use php -l somefile.php from the commandline. PARAMETERS
o $filename - The name of the file being checked. o $error_message - If the $error_message parameter is used, it will contain the error message generated by the syntax check. $error_message is passed by reference. RETURN VALUES
Returns TRUE if the lint check passed, and FALSE if the link check failed or if $filename cannot be opened. CHANGELOG
+--------+---------------------------------------------------+ |Version | | | | | | | Description | | | | +--------+---------------------------------------------------+ | 5.0.5 | | | | | | | This function was removed from PHP. | | | | | 5.0.3 | | | | | | | Calling exit(3) after php_check_syntax(3) | | | resulted in a Segfault. | | | | | 5.0.1 | | | | | | | $error_message is passed by reference. | | | | +--------+---------------------------------------------------+ EXAMPLES
php -l somefile.php The above example will output something similar to: PHP Parse error: unexpected T_STRING in /tmp/somefile.php on line 81 SEE ALSO
include(3), is_readable(3). PHP Documentation Group PHP_CHECK_SYNTAX(3)
All times are GMT -4. The time now is 08:15 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy