[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: HELP: w/ grep on a log file.



     THank for looking into this everyone. Turns out that the sed is not 
     necessary. The date "+ %a %b %d" statement needs to be modified! I 
     really need to get my shit together. The correct statement is 
     date "+%a %b %d" where the space between the + and the %a needs to be 
     removed.
     
     So the actuall statement could look something like:
     
     grep "$(date "+%a %b %e")" arch.log
     
     I am using the %e instead of the %d to strip the leading "0" from a 
     day such as ( 01 - 09).
     
     Every one - thank you for your time with my issue. It is very 
     reasuring to know that when the manual does not have the answers, that 
     many times our user group does.


______________________________ Reply Separator _________________________________
Subject: Re: HELP: w/ grep on a log file.
Author:  jhspies(p)Johann(a)alpha.futurenet.co.za at INTERNET
Date:    6/13/98 4:50 AM


Hallo, 
     
Sorry if this bores you, but I have never used sed before and after 
reading this discussion I checked the man page for sed.
     
What I would like to know is the following:
     
On Fri, 12 Jun 1998, Steve Mayer wrote:
     
>   Try grep "`date \"+ %a %b %d\" | sed 's/ //'`" arch.log
              ^                                 ^
> dave oswald wrote:
     
> > grep echo  \"`date "+ %a %b %d" | sed 's/ //'`\" arch.log
                 ^                               ^  
What is the meaning of the ` before date and after //'? 
What was wrong with dave oswald's effort? 
     
Why wouldn't 
     
grep \"`date "+ %a %b %d" | sed 's/ //'`\" arch.log
     
work?
     
Johann
 --------------------------------------------------------------------------
| Johann Spies                                 Windsorlaan 19              | 
| jhspies@alpha.futurenet.co.za                3201 Pietermaritzburg       | 
| Tel/Faks Nr. +27 331-46-1310                 Suid-Afrika (South Africa)  |
 --------------------------------------------------------------------------
     
     "Whether therefore ye eat, or drink, or whatsoever ye 
      do, do all to the glory of God."    
                                  I Corinthians 10:31 
     


--
To UNSUBSCRIBE, email to debian-user-request@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org


Reply to: