Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Grep exact IP address from file Post 302766459 by squoggle on Monday 4th of February 2013 05:48:58 PM
Old 02-04-2013
Great responses. I was able to get it sorted out "grep -w" was the ticket!
 

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
ATMADDR(8)						       Maintenance Commands							ATMADDR(8)

NAME
atmaddr - list and maintain local ATM addresses SYNOPSIS
atmaddr [-n] [itf] atmaddr -r [itf] atmaddr -a [itf] atm_addr atmaddr -d [itf] atm_addr atmaddr -V DESCRIPTION
atmaddr is used to list the local addresses configured for ATM interfaces and to manually change the list of addresses. If the interface number itf is omitted, interface 0 is used by default. The ATM address atm_addr can be any valid ATM SVC address, e.g. an E.164 address or an ATM Forum NSAP address. If invoked without options, atmaddr lists the addresses that are currently configured on the specified interface. Note that local ATM addresses are normally automatically maintained by the ILMI demon. OPTIONS
-a append the specified address at the end of the list. -d delete the specified address from the list. -n numeric address output only. No address to name translation is attempted. -r reset (clear) the local address list of the specified interface. -V print the version number of atmaddr on standard output and exit. AUTHOR
Werner Almesberger, EPFL ICA <Werner.Almesberger@epfl.ch> SEE ALSO
ilmid(8) Linux April 26, 2000 ATMADDR(8)
All times are GMT -4. The time now is 11:12 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy