Formatting list of IP addresses into a grep command


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Formatting list of IP addresses into a grep command
# 8  
Old 02-08-2012
Quote:
Originally Posted by balajesuri
Hmmm... It works for me. Not sure why it doesn't work for you.
May be, some random control characters have crept in either your script file or input file.
Thanks, will double check.

---------- Post updated at 12:14 PM ---------- Previous update was at 12:12 PM ----------

Quote:
Originally Posted by Scrutinizer
Why don't you use
Code:
zgrep -F -f random_ip.txt *.gz

Doesn't that work?

Seems to be working fine, thanks for that! Smilie
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Sifting out mail addresses with grep and regex

Hi there from a newbie. So, I have this huuuge portion of mail addresses with names interlaced.. looks like: "name1" <mail1@domain1.com>, "name2" <mail2@domain2.com> ... Sometimes there are no names, just mailaddress. My thought was to use regex with grep. I saved the list in file ma and... (2 Replies)
Discussion started by: dr_xemacs
2 Replies

2. Shell Programming and Scripting

Grep for all ip addresses mentioned in all files in a Directory

I wish to traverse all files and folders under a given directory say "/tmp/configuration" and for all ip address mentioned therein. I tried find ./ -type f | xargs grep "*.*.*.*" but it does not populated the correct results. Can you please suggest. (1 Reply)
Discussion started by: mohtashims
1 Replies

3. Homework & Coursework Questions

Search email addresses using grep command

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: Let's say if we have a file with a lot of information. For example: iiadam otterhedgehog kayleigh... (2 Replies)
Discussion started by: ForeignGuy
2 Replies

4. UNIX for Dummies Questions & Answers

Getting parameter list is too long in grep command

Hi i am getting below message while using grep command "The parameter list is too long" grep -i 919716499889 * ksh: /usr/bin/grep: 0403-027 The parameter list is too long. please let me know what changes i can do in this command (5 Replies)
Discussion started by: scriptor
5 Replies

5. UNIX for Dummies Questions & Answers

List Contacted Web Addresses?

Greetings. I'm in the process of tracking down an issue with Firefox, and need some way of gathering the actual web addresses which are connected to from localhost. The specific problem centers around the determination/capture of the exact generated app.update.url address formed by the... (2 Replies)
Discussion started by: LinQ
2 Replies

6. Shell Programming and Scripting

Extract list of IP addresses from a text file.

I have an xml file with IP addresses all over the show. I want to print only the IP addresses and cut off any text before or after the IP address. Example: Note: The IP addresses (x.x.x.x) do not consistently appear in the xml file as per the pattern below. Sometimes there are text before... (8 Replies)
Discussion started by: lewk
8 Replies

7. UNIX for Dummies Questions & Answers

analyzing list with street addresses

Hi List, Could someone please point me into the right direction with the following: I have a file containing a list of street addresses. I need to sort all the street addresses with the same number to a new file containing the street name and corresponding number. So: Strawinskylaan... (3 Replies)
Discussion started by: M474746
3 Replies

8. Solaris

Command to list all the VIP addresses assigned to Solaris server

Hello All, I want to list all the VIP addresses assigned to Solaris server. whats the command we have use on solaris for this? Please help Thanks!! Weblogic Consultant (1 Reply)
Discussion started by: weblogicsupport
1 Replies

9. UNIX Desktop Questions & Answers

Using Mailx to send to list of email addresses

Im trying to use a shell script to send to a list of email addresses in a txt file. Here is what i have tried but it keeps sending to dead.letter... Success.ksh contains... mailx -s"Night Batch Success" 'cat /Scripts/email_addresses.txt' < /Scripts/email_body_message.txt The email body... (1 Reply)
Discussion started by: aguad3
1 Replies

10. UNIX for Dummies Questions & Answers

Help extracting MAC addresses from List

Hello all. I have a large number of text files outputted from various Netstumbler Wireless Scans; from which I need to extract the MAC addresses of the various Access Points. The Text files look like this: # $Creator: Network Stumbler Version 0.4.0 # $Format: wi-scan summary with... (9 Replies)
Discussion started by: dhs23
9 Replies
Login or Register to Ask a Question