Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Grep exact IP address from file Post 302766457 by bakunin on Monday 4th of February 2013 05:47:13 PM
Old 02-04-2013
hm, my man page of grep says:

Code:
 -f FILE, --file=FILE
	      Obtain  patterns	from  FILE, one per line.  The empty file con-
	      tains zero patterns, and therefore matches nothing.

So i suppose

Code:
grep -wf address.list /path/to/other.file

would do the same as the loop, no?

I hope this helps.

bakunin
This User Gave Thanks to bakunin For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Want to grep exact pattern from file

Contents of my file is: DI DI DIR PHI I want to extract only DI. I am using below command grep -w DI <file> but it is also extracting DI. Can i use any other command to extract exact pattern where '[' does not have special meaning (4 Replies)
Discussion started by: nehashine
4 Replies

2. Shell Programming and Scripting

grep search for http address in a file.

Hi I have downloaded a HTM file from the web. What I want to do is perform a grep search of that file, searching for all strings where 'http' is present within the file, but only contains the word 'cache' within the string. I've includeda sample file, which I'm trying to extract the above... (5 Replies)
Discussion started by: colmbell
5 Replies

3. Shell Programming and Scripting

grep exact string from a file

Hi, I have the following output from a file zone "adm.test.com" { abc test1.db } zone "test.com" { xyz test2.db } zone "1.test.com.sg" { 1abc test3.db } zone "3.test.com.uk" { 1xyz test4.db } (6 Replies)
Discussion started by: vchee
6 Replies

4. Shell Programming and Scripting

grep ip address from file

I have a file $ cat ip12 11.22.33.44 192.68.1.2 helo l 72.34.34.200 333.444.555.666 12.23e.544.423 myip1 11.22.33.44 myip2 33.44.55.66 #fine this IP should also be listed I do $ cat ip12 | grep '^\{1,3\}\.\{1,3\}\.\{1,3\}\.\{1,3\}$' 11.22.33.44 192.68.1.2 (2 Replies)
Discussion started by: anil510
2 Replies

5. Shell Programming and Scripting

QUESTION1: grep only exact string. QUESTION2: find and replace only exact value with sed

QUESTION1: How do you grep only an exact string. I am using Solaris10 and do not have any GNU products installed. Contents of car.txt CAR1_KEY0 CAR1_KEY1 CAR2_KEY0 CAR2_KEY1 CAR1_KEY10 CURRENT COMMAND LINE: WHERE VARIABLE CAR_NUMBER=1 AND KEY_NUMBER=1 grep... (1 Reply)
Discussion started by: thibodc
1 Replies

6. Shell Programming and Scripting

echo exact xml tag from an exact file

Im stumped on this one. Id like to echo into a .txt file all names for an xml feed in a huge folder. Can that be done?? Id need to echo <name>This name</name> in client.xml files. $path="/mnt/windows/path" echo 'recording names' cd "$path" for names in $path than Im stuck on... (2 Replies)
Discussion started by: graphicsman
2 Replies

7. Shell Programming and Scripting

Grep IP address form a text file along with the subnet

I have an input file: class 1 3 5 10.10.10..0/23 hicks jimmy class 3 10.12.10.0/22 mike class.019283 10.10.15.10/20 henry gym.847585 45 192.168.10.0/22 nancy jim steve maya The output should look like this: 10.10.10..0/23 10.12.10.0/22 10.10.15.10/20 192.168.10.0/22 I have the... (3 Replies)
Discussion started by: e_mikey_2000
3 Replies

8. UNIX for Dummies Questions & Answers

Grep for ip address only from a file

Facing issues in grepping only the IP Address from a file i have tried the below and it was of not much help awk -F"" '/(/ { print $3 }' awk -F"</*(>" '/ip/ { print $2 }' grep "ip" file1|cut -f2 -d"<"|cut -f2 -d">" grep "(" file1 |cut -f2 -d"<"|cut -f2 -d">" grep -e... (9 Replies)
Discussion started by: satishcarya
9 Replies

9. Shell Programming and Scripting

Grep for an exact match in a file

I am currently having some issues while trying to grep for a exact string inside a file. I have tried doing this from command line and things work fine i.e. when no match is found, return code=1 but when its done as part of my script it returns 0 for the same command - I dont know if there is an... (6 Replies)
Discussion started by: Ads89
6 Replies

10. Shell Programming and Scripting

Grep -w ip address from a file isnt working need help

I have a file "file1" that contains several ip address , and the "file2" contains several records , each line in file2 contains somewhere the ip address that i am searching in the file1 I use the unix command grep -w for i in `cat file1` do grep -w "$i" file2 >> file3 done ... (9 Replies)
Discussion started by: knijjar
9 Replies
CLONE_MEMBER(8) 					      System Manager's Manual						   CLONE_MEMBER(8)

NAME
clone_member - Clone a Mailman mailing list subscriber address SYNOPSIS
clone_member [options] fromoldaddr tonewaddr DESCRIPTION
Cloning a member address means that a new member will be added who has all the same options and passwords as the original member address. Note that this operation is fairly trusting of the user who runs it -- it does no verification to the new address, it does not send out a welcome message, etc. The existing member's subscription is usually not modified in any way. If you want to remove the old address, use the -r flag. If you also want to change any list admin addresses, use the -a flag. OPTIONS
-l listname, --listname=listname Check and modify only the named mailing lists. If -l is not given, then all mailing lists are scanned from the address. Multiple -l options can be supplied. -r, --remove Remove the old address from the mailing list after it's been cloned. -a, --admin Scan the list admin addresses for the old address, and clone or change them too. -q, --quiet Do the modifications quietly. -n, --nomodify Print what would be done, but don't actually do it. Inhibits the 0 fromoldaddr (`from old address') is the old address of the user. tonewaddr (`to new address') is the new address of the user. AUTHOR
Author of Mailman is the Mailman Cabal, see http://www.list.org/ for information. This manpage is written by Tollef Fog Heen <tfheen@debian.org> for Debian, but may be used by others. SEE ALSO
Mailman documentation on http://www.list.org/ and in /usr/share/doc/mailman. 2007-07-14 CLONE_MEMBER(8)
All times are GMT -4. The time now is 07:35 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy