LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-25-2011, 02:07 AM   #1
sunildas49
LQ Newbie
 
Registered: Nov 2011
Posts: 2

Rep: Reputation: Disabled
For writing a unix shell script


I need to search .log files under 2 different directory exa:-/dir1/dir2/dir3 & /dir1/dir2/dir4
and find out the expected error like failed from that log files.

Could you please help me how to write in shell script for above requirement

Last edited by sunildas49; 11-25-2011 at 02:10 AM. Reason: for editing some line
 
Old 11-25-2011, 02:10 AM   #2
jhwilliams
Senior Member
 
Registered: Apr 2007
Location: Portland, OR
Distribution: Debian, Android, LFS
Posts: 1,168

Rep: Reputation: 210Reputation: 210Reputation: 210
Quote:
Originally Posted by sunildas49 View Post
I need to search .log files under 2 different directory exa:-/dir1/dir2/dir3 & /dir1/dir2/dir4
and find out the expected error like failed from that log files.

Could you please help me how to write in shell script for above requirement
Your question is not very specific, but this might do what you want

Code:
grep -ri 'error' dir[1-3]
 
Old 11-25-2011, 03:47 AM   #3
sunildas49
LQ Newbie
 
Registered: Nov 2011
Posts: 2

Original Poster
Rep: Reputation: Disabled
Thanks for your reply.....

I am very sorry for my 1st question because of not very specific

Once more i am explaining in detai my question:--


I need to search .log files errors which is present under /xyz/install and /xyz/abc/var/sadm/install and dispaly all the output errors

first time i am writing unix shell script..Pease help me how to write
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Writing Own Shell in Unix using fork,exec,dup etc kk11 Programming 13 12-20-2011 10:34 PM
[SOLVED] Writing First Script Unix - Deleting Directory Contents IamNoob_Help_ Programming 15 09-20-2011 04:39 AM
Need help writing Unix Shell script to pass file name,path,creation date ! windjashi Programming 4 10-08-2009 01:59 AM
Unix script writing enviroment for Windows stuaz Programming 2 07-04-2009 03:37 PM
Need Help in Writing a Shell Script. KptnKrill Linux - General 2 05-19-2003 06:44 AM


All times are GMT -5. The time now is 08:15 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration