Hi....
Erm, I'm no expert but....
for string in cat IP_text do
cat access.log | grep $string | cut -d <-- (see man cut for exact options)
>> output file
fi
Your problem is definately related to not using the cut command. grep will
only give you the entire line of text, I presume you only want the IP
address from the single line of text, and for that, cut works wonders!!!
Regards
Chris Knipe
Cell: (083) 430-8151
Natural ability without education has more often attained to glory and
virtue, than education without natural ability at all.
----- Original Message -----
From: Janez Vrenjak <[EMAIL PROTECTED]>
To: Linux Admin List <[EMAIL PROTECTED]>;
<[EMAIL PROTECTED]>
Sent: 07 July 2000 01:07
Subject: Sorting log
> Hello,
> I have the log file from squid.
> The second file is IP_text (one IP address per line)
>
> now I'd like to select all lines from log_file that contains one of the
> IP's in IP_text file
> and put that all in third file.
> Something like
> cat access.log|grep `cat IP_text`
> but that does't work :-(
>
> Any idea
> THX
> Janez
>
>
> --
>
> \\\___///
> \\ - - //
> ( @ @ )
> +-----------------------oOOo-(_)-oOOo---------------------------+
> | |
> | KONTRANET: WWW.KUD-KONTRABANT.SI |
> | WWW.KONTRABANT.COM |
> | |
> | Janez Vrenjak |
> | [EMAIL PROTECTED] [EMAIL PROTECTED] |
> | |
> | tel.: +386-(0)1-7227 595 |
> | +386-(0)61-172 40 11 |
> | +386-(0)41-571 440 |
> | |
> +------------------------------------Oooo-----------------------+
> oooO ( )
> ( ) ) /
> \ ( (_/
> \_)
> If you don't like the way I drive, stay off the sidewalk!
>
>
>
> -
> To unsubscribe from this list: send the line "unsubscribe linux-net" in
> the body of a message to [EMAIL PROTECTED]
-
To unsubscribe from this list: send the line "unsubscribe linux-net" in
the body of a message to [EMAIL PROTECTED]