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
Permissions - passing a file as the argument iago UNIX for Dummies Questions & Answers 1 09-11-2007 03:27 AM
how do I insert argument into TOP of file using vi? rprules UNIX for Dummies Questions & Answers 6 08-04-2007 06:33 PM
Inserting argument into top of a file Dev06 UNIX for Dummies Questions & Answers 7 10-05-2006 05:16 PM
argument help brentdeback Shell Programming and Scripting 2 11-27-2005 03:53 PM
file feed one line per argument jpprial UNIX for Dummies Questions & Answers 10 10-09-2001 11:22 AM

Closed Thread
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 Rate Thread Display Modes
  #1 (permalink)  
Old 01-24-2007
melanie_pfefer melanie_pfefer is offline
Registered User
  
 

Join Date: Nov 2006
Posts: 234
ls and take each file as argument

I have LOGFILES=`ls *.log` and want to egrep each entry of LOGFILES one after the other:


egrep $LOGFILE....

how to do that??

thx
  #2 (permalink)  
Old 01-24-2007
anbu23 anbu23 is offline Forum Advisor  
Registered User
  
 

Join Date: Mar 2006
Location: Bangalore,India
Posts: 1,398

Code:
cd /dir1/log_dir2
for fil in *.log
do
   egrep "string" $fil
done

  #3 (permalink)  
Old 01-24-2007
melanie_pfefer melanie_pfefer is offline
Registered User
  
 

Join Date: Nov 2006
Posts: 234
actually, the whole story is:

LOGFILES=`ls *.log | egrep -v "back|BS"`

and I want to do egrep $LOGFILE....

thanks in advance.
  #4 (permalink)  
Old 01-24-2007
anbu23 anbu23 is offline Forum Advisor  
Registered User
  
 

Join Date: Mar 2006
Location: Bangalore,India
Posts: 1,398

Code:
ls *.log | egrep -v "back|BS" > tmp
egrep -f tmp file

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 06:33 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