Sponsored Content
Top Forums Shell Programming and Scripting script not working after "tail -f" Post 302124841 by xander on Monday 2nd of July 2007 10:57:07 PM
Old 07-02-2007
Lightbulb How to get negated output

Hi
First thanks to all the genious minds who share their knowledge on this platform .
Smilie
Now Further i would like to ask that in this code to filter out the exceptions
Quote:
output of script gives
exception.InterfaceException: Error MNP duplicate found
hi
exception.InterfaceException: Error MNP duplicate found
hi
exception.InterfaceException: Error MNP duplicate found
hi
exception.InterfaceException: Error MNP duplicate found
hi
exception.CardPaymentException: Payment gateway rejected transaction
hi
exception.CardPaymentException: Payment gateway rejected transaction
hi
exception.CardPaymentException: Payment gateway rejected transaction
hi
exception.CardPaymentException: Failed to retrieve digital receipt from database
hi
exception.TaxStrategyException: Error during port.getTax(getTaxRequest)) Error
hi
How can we negate the output i.e the code
Quote:
#!/bin/bash
tail -f abc.log |
while read -r line
do
[[ "$line" != *exceptions* ]] && continue
echo $line
echo hi
done
should give the output other than the above mentioned i.e after filtering out the above exceptions . it should display all the other kind of exceptions coming . for example output should be :
Quote:
exception.DatabaseException: Database error occured
hi
exception.DatabaseException: Database error occured -311
hi
exception.InterfaceException:Anu no found
hi
exception.InterfaceException: Error checking linked numbers, negative ani position
hi
exception.CardPaymentException: Error checking linked numbers, negative ani position
hi
exception.DatabaseException: Database error occured -311
hi
exception.DatabaseException: Database error occured
hi
exception.DatabaseException: Error checking linked numbers, negative ani position
hi
exception.TaxStrategyException: calculate tax failed
hi
Thanks Smilie

Last edited by xander; 07-03-2007 at 10:42 AM..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Perl - immitate perpetual "tail"

Is there some way I can have a script monitor the newest line of a log file until a certain entry gets placed in the log? Basically I want to start this script, and have it spit up the last 10 lines or so to a browser via AJAX... the AJAX is not my problem though, as I have no idea how to go... (4 Replies)
Discussion started by: jjinno
4 Replies

2. Shell Programming and Scripting

Script not working..."sort" not working properly....

Hello all, I have a file - 12.txt cat 12.txt =============================================== Number of executions = 2 Total execution time (sec.ms) = 0.009883 Number of executions = 8 Total execution time (sec.ms) = 0.001270 Number of... (23 Replies)
Discussion started by: Rahulpict
23 Replies

3. Shell Programming and Scripting

"sed" command is not working in shell script

Hi All, I am not much strong in shell scripting... I am using sed command in my script to find and replace a string....... This is how script looks : ############# #!/usr/bin/ksh CONFIG_FILE=iom_test.txt FIND=`echo "NIS_FTP_SERVER1=123.456.iom.com"` REPLACE=`echo... (2 Replies)
Discussion started by: askumarece
2 Replies

4. UNIX for Dummies Questions & Answers

using "tail -f" in script

I am trying to use this script however it is not running well #!/bin/sh tail -f filename | grep -i -E 'error|warning' the code does not display the first 10 lines of the file that I want to check since after the file grow, it cannot grep "warning" as well #!/bin/sh A=`tail -f filename... (5 Replies)
Discussion started by: ikeQ
5 Replies

5. Shell Programming and Scripting

awk command to replace ";" with "|" and ""|" at diferent places in line of file

Hi, I have line in input file as below: 3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL My expected output for line in the file must be : "1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL" Can someone... (7 Replies)
Discussion started by: shis100
7 Replies

6. UNIX for Dummies Questions & Answers

"tail -n 1 filename" error while "head -n 1 filename" is ok?

Hi all, I was wondering why tail -n 2 filename produce an error when I manage to do similar command on head -n 2 filename SunOS{type8code0}: tail -n 2 filename usage: tail ] tail ] (2 Replies)
Discussion started by: type8code0
2 Replies

7. Shell Programming and Scripting

"find . -printf" without prepended "." path? Getting path to current working directory?

If I enter (simplified): find . -printf "%p\n" then all files in the output are prepended by a "." like ./local/share/test23.log How can achieve that a.) the leading "./" is omitted and/or b.) the full path to the current directory is inserted (enclosed by brackets and a blank)... (1 Reply)
Discussion started by: pstein
1 Replies

8. Shell Programming and Scripting

"if" Loop not working when executing script using cron

I am facing this weird issue where the script is working fine from the command line but when I am executing it from cron though it is working fine but the "if" loop is processing else part though I know that the if part of the logic is true and ideally the loop should execute the if portion. ... (3 Replies)
Discussion started by: sk2code
3 Replies

9. UNIX for Beginners Questions & Answers

Automate "touch" bash script not working.

#!/bin/bash -i SAVEIFS=$IFS IFS=$"\n\b" picc=$* if ; then echo $TDATE if ; then touch dummy touch -t "tdate" dummy touch -r "dummy" "$picc" else echo -e "No mod date value to apply. If there is one in your shell,\ninvoke \eStarted asking advice on this (on Linuxquestions.org).... (9 Replies)
Discussion started by: iamwrong
9 Replies

10. Shell Programming and Scripting

Bash script - Print an ascii file using specific font "Latin Modern Mono 12" "regular" "9"

Hello. System : opensuse leap 42.3 I have a bash script that build a text file. I would like the last command doing : print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt where : print_cmd ::= some printing... (1 Reply)
Discussion started by: jcdole
1 Replies
tgamma(3M)						  Mathematical Library Functions						tgamma(3M)

NAME
tgamma, tgammaf, tgammal - compute gamma function SYNOPSIS
c99 [ flag... ] file... -lm [ library... ] #include <math.h> double tgamma(double x); float tgammaf(float x); long double tgammal(long double x); DESCRIPTION
These functions compute the gamma() function of x. RETURN VALUES
Upon successful completion, these functions return gamma(x). If x is a negative integer, a domain error occurs and a NaN is returned. If the correct value would cause overflow, a range error occurs and tgamma(), tgammaf(), and tgammal() return the value of the macro +-HUGE_VAL, +-HUGE_VALF, or +-HUGE_VALL, respectively. If x is NaN, a NaN is returned. If x is +-Inf, x is returned. If x is +-0, a pole error occurs and tgamma(), tgammaf(), and tgammal() return +-HUGE_VAL, +-HUGE_VALF, and +-HUGE_VALL, respectively. If x is +Inf, a domain error occurs and a NaN is returned. ERRORS
These functions will fail if: Domain Error The value of x is a negative integer or x is -Inf. If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the invalid floating-point exception is raised. Pole Error The value of x is zero. If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the divide-by-zero floating-point exception is raised. Range Error The value overflows. If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the overflow floating-point exception is raised. USAGE
An application wanting to check for exceptions should call feclearexcept(FE_ALL_EXCEPT) before calling these functions. On return, if fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an exception has been raised. An application should either examine the return value or check the floating point exception flags to detect exceptions. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Interface Stability |Standard | +-----------------------------+-----------------------------+ |MT-Level |MT-Safe | +-----------------------------+-----------------------------+ SEE ALSO
feclearexcept(3M), fetestexcept(3M), lgamma(3M), math.h(3HEAD), attributes(5), standards(5) SunOS 5.11 12 Jul 2006 tgamma(3M)
All times are GMT -4. The time now is 04:55 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy