The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

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
Problem with csh script rahulrathod Shell Programming and Scripting 4 02-21-2008 12:38 PM
script problem tdavenpo Shell Programming and Scripting 3 01-04-2006 04:07 PM
Problem starting a script from a 'main'-script Rakker UNIX for Dummies Questions & Answers 3 06-28-2005 08:12 AM
script problem Bab00shka Shell Programming and Scripting 4 09-16-2002 10:21 AM
problem with ftp script...please help vancouver_joe UNIX for Advanced & Expert Users 2 11-22-2001 07:47 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 06-10-2005
Lestat's Avatar
Lestat Lestat is offline
Registered User
  
 

Join Date: Feb 2005
Location: Quito - Ecuador
Posts: 67
Exclamation problem with a script

Hello again,

I have a script to read the last line writed in a file, make a grep and if the grep match, write this line into another file (that is what i want)

script
tail -f router_transaction.log | grep 'R-.*_RESP' | grep -v 0x00000000

this show me in screen what i want but when i change it to:

tail -f router_transaction.log | grep 'R-.*_RESP' | grep -v 0x00000000 >> errores
the errores file dont fill with what i want... why?

evey i try:

tail -f router_transaction.log | grep 'R-.*_RESP' | grep -v 0x00000000 > errores

but dont work, why?
  #2 (permalink)  
Old 06-10-2005
Kelam_Magnus's Avatar
Kelam_Magnus Kelam_Magnus is offline Forum Advisor  
Registered User
  
 

Join Date: Aug 2001
Location: DFW McKinney, TX,
Posts: 1,069
tail -f is a constant stdout command... You can't capture it and pipe to an output. The tail -f is waiting to update with new info coming into the file and will never complete your command line. it will appear to hang.

You will have to either do a tail -NNN where N is some number or cp to a filename then capture the data you want.
  #3 (permalink)  
Old 06-10-2005
vgersh99's Avatar
vgersh99 vgersh99 is online now Forum Staff  
Moderator
  
 

Join Date: Feb 2005
Location: Boston, MA
Posts: 5,119
but you can 'tee -a' it
  #4 (permalink)  
Old 06-13-2005
Lestat's Avatar
Lestat Lestat is offline
Registered User
  
 

Join Date: Feb 2005
Location: Quito - Ecuador
Posts: 67
vgersh please could you explain me better your command? i maen, can i do:

tee -a <source> <new> ???
  #5 (permalink)  
Old 06-13-2005
Lestat's Avatar
Lestat Lestat is offline
Registered User
  
 

Join Date: Feb 2005
Location: Quito - Ecuador
Posts: 67
Maybe i need to explain better what i have and what i need.

In 'errores.log' i have a lot of transactions logs, succesfull and with errors, another process fill this file in real time.

i want to get all thet logs with errors and fill another file with them.

Is this more clrear?
Sponsored Links
Closed Thread

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 01:54 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