Re: Sorting log

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

 



> This is what i typed:
> grep `cat IP_text` /var/log/messages
> 
> 
> file IP_text:
> 
> #cat IP_text
> 192.168.2.2
> 192.168.2.3

The problem is it doesn't know that newline is the start of a different pattern.
In fact, as I recall the shell will parse the result of `cat IP_text` into
arguments, so I'm surprised that doesn't give you an ocean of file not found
errors.

Try
	grep --file='IP_text' /var/log/messages

Keep in mind that a period (.) matches any character except newline, so you may
end up with a few IPs that weren't in the list.

	-- Brian
-
: send the line "unsubscribe linux-net" in
the body of a message to majordomo@vger.rutgers.edu


[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux 802.1Q VLAN]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Git]     [Bugtraq]     [Yosemite News and Information]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux PCI]     [Linux Admin]     [Samba]

  Powered by Linux