Dear Rodolfo J. Paiz

I have another queston?

I would like to display 
because It takes too long to read the latest when our
messages is very big

> Jan 24 09:09:26  syslogd 1.4-0: restart.
> Jan 24 08:09:24  syslog: syslogd startup succeeded
> Jan 24 07:09:24  syslog: klogd startup succeeded

not

> Jan 24 07:09:24  syslogd 1.4-0: restart.
> Jan 24 08:09:24  syslog: syslogd startup succeeded
> Jan 24 09:09:24  syslog: klogd startup succeeded


In fact, why don't have tail -r this function?

Thank you


--- "Rodolfo J. Paiz" <[EMAIL PROTECTED]> wrote:
> At 1/24/2002 02:08 PM -0500, you wrote:
> >But why two commands take different results
> >and last one doesn't apply it?
> 
> Because I made a mistake. :)
> 
> The second should be:
> 
> # grep "`date +'%b %e'`" /var/log/messages | less
> 
> >Second: doesn't work, start from Jan 20
> >[root@ log]# grep `date +"%b %e"` /var/log/messages
> |
> >less|more
> 
> The mistake is that the `date` stuff in between the
> backticks is replaced 
> *only* by the result of the command. So that command
> becomes:
> 
> (wrong)
> # grep Jan 24 /var/log/messages | less
> 
> grep is only expecting one argument, so it uses
> "Jan" as the search string 
> and then thinks "24" and "/var/log/messages" are the
> files to search. No 
> file named "24" exists, so it issues an error and
> then goes on to the 
> second file. All the lines in the second file
> contain the string "Jan" so 
> the entire file is given to you.
> 
> I used double quotes on the outside and single
> quotes on the inside so that 
> the shell wouldn't be confused about which quote is
> paired with which other.
> 
> Note that "less" does the same thing as "more", so
> you don't need to use 
> both. Pick one of the two; less does a little extra,
> but more is easier to 
> learn for newbies.
> 
> The reason I gave you the second command is because
> you might want to put 
> it into a short script, and it will work every day
> without you typing 
> anything specific.
> 
> 
> --
> Rodolfo J. Paiz
> [EMAIL PROTECTED]
> 
> 
> 
> _______________________________________________
> Redhat-list mailing list
> [EMAIL PROTECTED]
>
https://listman.redhat.com/mailman/listinfo/redhat-list


______________________________________________________________________ 
Web-hosting solutions for home and business! http://website.yahoo.ca



_______________________________________________
Redhat-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-list

Reply via email to