Sponsored Content
Top Forums Shell Programming and Scripting Writing a script for multiple occurence of IP_Add in 3 diffrent directories . Post 302461774 by rajkumar_g on Tuesday 12th of October 2010 07:45:16 AM
Old 10-12-2010
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 extarct the IP's under below directories only and redirect into a text file.

/fdp/cdg/mms
/fdp/cdg/cpd
/fdp/cdg/abs.

so please help me to write a script for the above scenario.Smilie

I am looking forward from you.

Thanks in Advance
Siva Ranganath Ch.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

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?:) (4 Replies)
Discussion started by: sivaranga001
4 Replies

2. 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

3. Shell Programming and Scripting

how to write a script for existing of IP_add in the files under paticular paths.

Hello , I want to write a script to test the IP_add is hardcoded in the paticular files. the files are available in path . for example. /abs/abn/jkg/frames.sh. like this some files are there in the same path.I manually replaced the IP_ADD with domain name in required files.now i have to... (1 Reply)
Discussion started by: rajkumar_g
1 Replies

4. UNIX for Dummies Questions & Answers

Writing a loop to manipulate a script and store it in multiple output files

I have a script where the the 9th line looks like this: $filename=sprintf("250.1chr%d.ped", $N); I want to modify this script 1000 times, changing 250.1chr%d.ped to 250.2chr%d.ped, 250.3chr%.ped.......and so on all the way to 250.1000chr%d.ped and store each output in files called ... (4 Replies)
Discussion started by: evelibertine
4 Replies

5. Shell Programming and Scripting

Writing a Perl Script that processes multiple files

I want to write a Perl script that manipulates multiple files. In the directory, I have files 250.*chr$.ped where * is from 1 to 1000 and $ is from 1-22 for a total of 22 x 10,000 = 22,000 files. I want to write a script that only manipulates files 250.1chr*.ped where * is from 1 to 22.... (10 Replies)
Discussion started by: evelibertine
10 Replies

6. UNIX for Dummies Questions & Answers

Writing a loop to process multiple input files by a shell script

I have multiple input files that I want to manipulate using a shell script. The files are called 250.1 through 250.1000 but I only want the script to manipulate 250.300 through 250.1000. Before I was using the following script to manipulate the text files: for i in 250.*; do || awk... (4 Replies)
Discussion started by: evelibertine
4 Replies

7. UNIX for Dummies Questions & Answers

Deleting multiple directories inside multiple directories

Hi, Very unfamiliar with unix/linux stuff. Our admin is on vacation so, need help very quickly. I have directories (eg 40001, 40002, etc) that each have one subdirectory (01). Each subdir 01 has multiple subdirs (001, 002, 003, etc). They are same in each dir. I need to keep the top and... (7 Replies)
Discussion started by: kkouraus1
7 Replies

8. Shell Programming and Scripting

Writing an snmp script to grab multiple oids at once

is it possible to grab the following oids with one invocation of the snmp command, instead of having to run separate commands: snmpwalk -v2c -c commst hostname hrStorageUsed snmpwalk -v2c -c commst hostname hrStorageDescr snmpwalk -v2c -c commst hostname hrStorageAllocationUnits ... (2 Replies)
Discussion started by: SkySmart
2 Replies

9. UNIX for Dummies Questions & Answers

Writing a script to print the number of lines in multiple files

Hi I have 1000 files labelled data1.txt through data1000.txt. I want to write a script that prints out the number of lines in each txt file and outputs it in the following format: Column 1: number of data file (1 through 1000) Column 2: number of lines in the text file Thanks! (2 Replies)
Discussion started by: evelibertine
2 Replies

10. Open Source

Help with writing Shell Script to automate process using multiple commands

Hello! Need help to write a Linux script that can be run from windows using command/Cygwin/any other way. I am new to scripting, actually i am trying to automate server health check like free disk space, memory along with few services status, if any services is not running then start services ,... (7 Replies)
Discussion started by: Sayed Ibrahim
7 Replies
Info::FDP(3pm)						User Contributed Perl Documentation					    Info::FDP(3pm)

NAME
SNMP::Info::FDP - SNMP Interface to Foundry Discovery Protocol (FDP) using SNMP AUTHOR
Bruce Rodger, Max Baker SYNOPSIS
my $fdp = new SNMP::Info ( AutoSpecify => 1, Debug => 1, DestHost => 'router', Community => 'public', Version => 2 ); my $class = $fdp->class(); print " Using device sub class : $class "; $hasfdp = $fdp->hasFDP() ? 'yes' : 'no'; # Print out a map of device ports with FDP neighbors: my $interfaces = $fdp->interfaces(); my $fdp_if = $fdp->fdp_if(); my $fdp_ip = $fdp->fdp_ip(); my $fdp_port = $fdp->fdp_port(); foreach my $fdp_key (keys %$fdp_ip){ my $iid = $fdp_if->{$fdp_key}; my $port = $interfaces->{$iid}; my $neighbor = $fdp_ip->{$fdp_key}; my $neighbor_port = $fdp_port->{$fdp_key}; print "Port : $port connected to $neighbor / $neighbor_port "; } DESCRIPTION
SNMP::Info::FDP is a subclass of SNMP::Info that provides an object oriented interface to FDP information through SNMP. FDP is a Layer 2 protocol that supplies topology information of devices that also speak FDP, mostly switches and routers. It has similar functionality to Cisco's CDP, and the SNMP interface is virtually identical. FDP is implemented in Foundry devices, including the Bigiron and Fastiron range. Create or use a device subclass that inherits this class. Do not use directly. Each device implements a subset of the global and cache entries. Check the return value to see if that data is held by the device. Inherited Classes None. Required MIBs FOUNDRY-SN-SWITCH-GROUP-MIB Needs a reasonably recent MIB. Works OK with B2R07604A.mib, but doesn't work with B2R07600C. GLOBAL METHODS
These are methods that return scalar values from SNMP $fdp->hasFDP() Is FDP is active in this device? Accounts for SNMP version 1 devices which may have FDP but not fdp_run() $fdp->fdp_run() Is FDP enabled on this device? ("fdpGlobalRun") $fdp->fdp_interval() Interval in seconds at which FDP messages are generated. ("fdpGlobalMessageInterval") $fdp->fdp_holdtime() Time in seconds that FDP messages are kept. ("fdpGlobalHoldTime") $fdp->fdp_id() Returns FDP device ID. This is the device id broadcast via FDP to other devices, and is what is retrieved from remote devices with $fdp->id(). ("fdpGlobalDeviceId") Overrides CDP compatibility $fdp->c_interval() Interval in seconds at which FDP messages are generated. ("fdpGlobalMessageInterval") $fdp->c_holdtime() Time in seconds that FDP messages are kept. ("fdpGlobalHoldTime") $fdp->c_id() Returns FDP device ID. This is the device id broadcast via FDP to other devices, and is what is retrieved from remote devices with $fdp->id(). ("fdpGlobalDeviceId") $cdp->cdp_run() Is FDP enabled on this device? TABLE METHODS
These are methods that return tables of information in the form of a reference to a hash. Overrides CDP compatibility $fdp->c_capabilities() Returns Device Functional Capabilities. Results are munged into an ascii binary string, 7 digits long, MSB. Each digit represents a bit from the table below. From <http://www.cisco.com/univercd/cc/td/doc/product/lan/trsrb/frames.htm#18843>: (Bit) - Description(0x40) - Provides level 1 functionality.(0x20) - The bridge or switch does not forward IGMP Report packets on non router ports.(0x10) - Sends and receives packets for at least one network layer protocol. If the device is routing the protocol, this bit should not be set.(0x08) - Performs level 2 switching. The difference between this bit and bit 0x02 is that a switch does not run the Spanning-Tree Protocol. This device is assumed to be deployed in a physical loop-free topology.(0x04) - Performs level 2 source-route bridging. A source-route bridge would set both this bit and bit 0x02.(0x02) - Performs level 2 transparent bridging.(0x01) - Performs level 3 routing for at least one network layer protocol. Thanks to Martin Lorensen "martin -at- lorensen.dk" for a pointer to this information. ("fdpCacheCapabilities") $fdp->c_domain() The CDP version of this returns remote VTP Management Domain as defined in "CISCO-VTP-MIB::managementDomainName" ("fdpCacheVTPMgmtDomain") $fdp->c_duplex() Returns the port duplex status from remote devices. ("fdpCacheDuplex") $fdp->c_id() Returns remote device id string ("fdpCacheDeviceId") $fdp->c_if() Returns the mapping to the SNMP Interface Table. Note that a lot devices don't implement $fdp->fdp_index(), So if it isn't around, we fake it. In order to map the fdp table entry back to the interfaces() entry, we truncate the last number off of it : # it exists, yay. my $fdp_index = $device->fdp_index(); return $fdp_index if defined $fdp_index; # if not, let's fake it my $fdp_ip = $device->fdp_ip(); my %fdp_if foreach my $key (keys %$fdp_ip){ $iid = $key; ## Truncate off .1 from fdp response $iid =~ s/.d+$//; $fdp_if{$key} = $iid; } return \%fdp_if; $fdp->c_index() Returns the mapping to the SNMP2 Interface table for FDP Cache Entries. Most devices don't implement this, so you probably want to use $fdp->fdp_if() instead. See fdp_if() entry. ("fdpCacheIfIndex") $fdp->c_ip() Returns remote IP address ("fdpCacheAddress") $fdp->c_platform() Returns remote platform id ("fdpCachePlatform") $fdp->c_port() Returns remote port ID ("fdpDevicePort") $fdp->c_proto() Returns remote address type received. Usually IP. ("fdpCacheAddressType") $fdp->c_ver() Returns remote hardware version ("fdpCacheVersion") $fdp->c_vlan() Returns the remote interface native VLAN. ("fdpCacheNativeVLAN") perl v5.12.4 2011-09-28 Info::FDP(3pm)
All times are GMT -4. The time now is 05:24 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy