Searching of IP_add in multiple scripts! ASAP


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Searching of IP_add in multiple scripts! ASAP
# 1  
Old 09-24-2010
Searching of IP_add in multiple scripts! ASAP

Hello Friends,


Plz help me for below query?
I want search the IP_ADD from multiple files which are txt file or .sh files or .xml files which are present in different directories .Iam looking for Forum memebers help.

Advance thanks to forum memebers.Plz reply me ASAP?Smilie
# 2  
Old 09-24-2010
Code:
ruby -e 'Dir["**/*.{xml,sh,txt}"].each{|x| a=File.read(x); puts x if !a.scan(/ip_addr/).empty?  }'

# 3  
Old 09-24-2010
try this,

Code:
find . -type f \( -name '*.txt' -o -name '*.sh' -name '*.xml' \) -print | xargs grep "IP_ADD"

# 4  
Old 09-24-2010
thanks for quick reply

But its failed.I done manually search in all directirories and i found in one xml file is in below format.
Param name ="Host" value = "198.256.10.1"
Param name ="User" value = "xx34445xsdasd"
Param name ="Password" value = "fd34445xsdasd"
so wht is query is the above format is present other files in other directories.so can u plz give right command .then i can able find easly.
lot many files are to search.Plz help.
# 5  
Old 09-24-2010
try this,

Code:
find . -type f \( -name '*.txt' -o -name '*.sh' -name '*.xml' \) -print | xargs grep  '\"[0-9]\{1,3\}\.[0-9]\{1,3\}.[0-9]\{1,3\}.[0-9]\{1,3\}\"'

Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Calling multiple scripts from another scripts

Dear all, I am working on script which call other shell scripts in a loop but problem is from second script am not able to come out. Here is the snippet:- #!/bin/bash HSFILE=/root/Test/Components.txt LOGFile=/opt/domain/AdminDomain/application/logs... (3 Replies)
Discussion started by: sharsour
3 Replies

2. Shell Programming and Scripting

Nawk help searching for multiple lines and multiple searches

I use this command to find a search (Nr of active alarms are) and print one line before and 10 lines after the search keywords. nawk 'c-->0;$0~s{if(b)for(c=b+1;c>1;c--)print r;print;c=a}b{r=$0}' b=1 a=10 s="Nr of active alarms are:" *.log However, I would like to know how to tell it to print... (3 Replies)
Discussion started by: tthach830
3 Replies

3. Shell Programming and Scripting

searching different multiple directories

Suppose I have 5 different directories in some path .Is it possible to search 5 different directories using find command in one single command line. I mean something like this:- find path -type d -name dirname1 dirname2 .......... pls help (2 Replies)
Discussion started by: maitree
2 Replies

4. Shell Programming and Scripting

Writing a script for multiple occurence of IP_Add in 3 diffrent directories .

Hello members. How can i write a script to find a multiple occurence of IP_ADD in the 3 different directories and under one path.after finding the IP_add redirect into a text file. for example home dir: /fdp/cdg under home directory there are several files and directories.so I have to... (1 Reply)
Discussion started by: rajkumar_g
1 Replies

5. Shell Programming and Scripting

Searching of IP_add in multiple scripts

Hi forum memebers, I want know what is the grep command a IP_add or host in the multiple scripts in one directory. Thanks in advance. Siva Ranganath.:) (3 Replies)
Discussion started by: sivaranga001
3 Replies

6. IP Networking

abt IP_ADD to DNS-- Plz help me:ASAP

Hello to forum memebers, Please help for below querry. I am new n/w programming ,I wan to know abt the how to change IP to Domain name thorugh Shell script. I am looking for ur reply. Plz......... advance thanks to Forum.:) (2 Replies)
Discussion started by: sivaranga001
2 Replies

7. UNIX for Dummies Questions & Answers

Searching multiple items

Hi, I'm a complete newbie so bear with me. I have a directory (and sub-dirs) full of .doc, .xls files. What I'm trying to do is do a single search within the files (i.e. within each .doc etc) for occurrences of multiple items e.g. apples, pears, grapes, bananas. Basically I'd provide a... (4 Replies)
Discussion started by: kainfs
4 Replies

8. Shell Programming and Scripting

Email searching with in scripts

Hi guys.. Would anyone know the best way to search 700 odd scripts so that it returns certain required results? I need the search to return the script name, subject and any email address found. The mail part of the script will look something like below and there can be more than one... (1 Reply)
Discussion started by: Jazmania
1 Replies

9. Shell Programming and Scripting

Searching multiple files with multiple expressions

I am using a DEC ALPHA running Digital UNIX (formly DEC OSF/1) and ksh. I have a directory with hundreds of files that only share the extension .rpt. I would like to search that directory based on serial number and operation number and only files that meet both requirements to be printed out. I... (6 Replies)
Discussion started by: Anahka
6 Replies
Login or Register to Ask a Question