Re: find string from command outut in log file

From: Bit Twister (BitTwister_at_localhost.localdomain)
Date: 08/08/03


Date: Fri, 08 Aug 2003 12:55:54 GMT

On 7 Aug 2003 22:13:44 -0700, Cliff Chittenden wrote:
> Bit Twister <BitTwister@localhost.localdomain> wrote in message news:<slrnbj48co.1um.BitTwister@wb.home>...
>> On 7 Aug 2003 01:13:21 -0700, Cliff Chittenden wrote:
>> > I am no Unix expert and what I wish to achieve is a little difficult
>> > to describe, so please bear with me! Whilst tailing a log file I run
>> > a command string (I suspect this command string is an internally
>> > written script of some kind) which writes a list to the log. The list
>> > is quite long and wide and I need to find a particular string in the
>> > output. My eyes aren't what they used to be, so I'd like to filter
>> > out the string I am interested in and just write the lines containing
>> > said string to the log. Any ideas?
>>
>> try man grep
>>
>> Example: grep string_2_find from_some_filename_here > my.log
>
> Thanks Bit Twister, but that's not quite what I was after. It
> requires that I first run my command to send the list to the log file
> and then run grep on the log. I'd like something that writes just the
> lines I require to the log. Because I am already running a tail on
> the log, I will see the lines I want as they are written to the log.
> Any help on this would be greatly apreciated.

tail -f from_some_filename_here | grep string_2_find > my.log

Even though bash is not unix, some light reading found at
http://www.tldp.org/LDP/abs/html/index.html



Relevant Pages

  • Re: MacTeX 2007 and documentation
    ... may be the most useful command available when doing searches at the ... will find every file on your system that has the text "memoir" on it, ... If locate generates 30 lines of text, where each line is a file, grep ... I need a Unix guru to chat to for half an hour or so to put me straight. ...
    (comp.text.tex)
  • Re: piping multiple selections to mv or cp and exclusion
    ... pipe to shell to execute each command statement ... Unix is indeed lifelong learning :-) ... and the regexp. ... back into the grep statement. ...
    (comp.unix.shell)
  • Re: MacTeX 2007 and documentation
    ... means you need expertise in your host operating system as well. ... locate memoir | grep pdf ... I'm not someone who lives at the command line, ...
    (comp.text.tex)
  • Re: Program to scan directories
    ... Is there a UNIX command which scans directories and execute any other ... the regex you specify here is /not/ given to grep to ... entries (files and subdirectories). ... tell grep to recurse through the kpathsea directory (the *.h regex ...
    (comp.unix.programmer)
  • Re: Using the grep command to filter
    ... I am a college student currently enrolled in a Unix class. ... that ubuntu Ubuntu UBUNTU ubunTU whatever in them. ... grep ubuntu /etc/* of course. ... Now look at the output of that grep command will give you all the ...
    (comp.unix.shell)