The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
script running with "ksh" dumping core but not with "sh" simhe02 HP-UX 9 11-04-2008 08:52 PM
Explain the line "mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'`" Lokesha UNIX for Dummies Questions & Answers 4 12-20-2007 01:52 AM
Perl - immitate perpetual "tail" jjinno Shell Programming and Scripting 4 08-23-2007 12:42 AM
Listing only directories in the current working directory using the "ls" command igandu UNIX for Dummies Questions & Answers 2 05-12-2006 05:47 AM
pf not working properly even with only "pass in all" and "pass out all" rules xyyz UNIX for Advanced & Expert Users 4 12-30-2003 05:33 AM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rating: Thread Rating: 1 votes, 5.00 average. Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 07-01-2007
xander xander is offline
Registered User
  
 

Join Date: Jun 2007
Posts: 25
Angry script not working after "tail -f"

Hi Everyone ,

I am facing a strange problem
i have made the follwing script to watch a appending log file (abc.log) but its not moving after the line tail -f ,
any suggestions

=====================================
#!/bin/bash
while true
do
tail -f abc.log | grep "exceptions"
echo hi
done
===================================

but the script keeps on giving the exceptions output as follows:

exception.TaxStrategyException: Error during port.getTax
exception.InterfaceException: Error MNP duplicate found
exception.CardPaymentException: Payment gateway rejected

and i want the out put to be as follows :------
exception.TaxStrategyException: Error during port.getTax
hi
exception.InterfaceException: Error MNP duplicate found
hi
exception.CardPaymentException: Payment gateway rejected
hi
================================================

the basic problem i have seen is that tail -f keeps on checking the appending log file due to which it doesnot ends up and the second command
echo hi never gets executed.

Please help me if there is any other way of doing this

Thanks
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 08:03 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0