Sponsored Content
Top Forums Shell Programming and Scripting need help writing a script in Windows Post 302355564 by aigles on Wednesday 23rd of September 2009 05:20:51 AM
Old 09-23-2009
Shell script ?

---------- Post updated at 11:20 ---------- Previous update was at 11:02 ----------

With bash, you can try something like that (not tested) :
Code:
adr=.1.3.6.1.4.1.232.18.2.3.1.1
adr34=${adr}.34
adr33=${adr}.33

for ((i=1; i<=256; i++))
do

   value=$(snmputil get localhost public ${adr34}.$i | awk '/Value/ {print $3}')
   if [ "${value}" = "2" ]
   then
      value=$(snmputil get localhost public ${adr33}.$i | awk '/Value/ {print $3}')
      if [ "${value}" != "1000000000" ]
      then
         echo "NIC $i not running gig (${value})"
      fi
   fi
done
exit

Jean-Pierre.
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Writing Script?

Anyone have an example of a simple shell script that solicits a (Y)es or (N)o response from the user. If the response is 'Y' display a message on the screen that thanks the user for the positive response. If the response is 'N' display a message that thanks the user for the negative response. If... (15 Replies)
Discussion started by: wmosley2
15 Replies

2. UNIX for Dummies Questions & Answers

help for writing a script

Hi, I need help writing a unix script to change the time in the server automatically when it reaches a specified time. Only on the 14th of april, when the time becomes midnight (00:00:00), I need the server to change the time automatically to 23:30:00 and start working on as usual with a... (2 Replies)
Discussion started by: amodha
2 Replies

3. Shell Programming and Scripting

Writing the script

I whant write the script of monitoring my servers on night-active users. He must loging all user actions, when user login, when logout, when he do su etc. But i don't know with what to begin :( How command i can use? awk, sed, last And what logs i can use too? /var/log/messages, /var/log/secure... (1 Reply)
Discussion started by: jess_t03
1 Replies

4. UNIX for Dummies Questions & Answers

UFS CD-ROM file-writing in Windows?

Is it possible to write files in a Windows application, in UFS, onto a CDROM that can then be read by a SUN workstation? If so, can anyone point me in the direction of an application that can let me do this? Thanks. (1 Reply)
Discussion started by: NeilAtkins
1 Replies

5. UNIX for Dummies Questions & Answers

Need help writing this script

Here is the script I am trying to write along with my answer I wrote. Please help me understand why it doesn't work. Create an executable script file called "newname" that will perform the followings: 1. Rename a file upon the user's request. If the file exists, prompt the user for... (1 Reply)
Discussion started by: wiggles
1 Replies

6. Shell Programming and Scripting

Help me in writing the script

Hi, I have written a script which converts a give hexdecimal value to binary value in perl. But now, the problem is I should read every bit of it ( if its 10101010, i should read the value in each position and if the value in that position is 1 i should print a string and should exit if its... (1 Reply)
Discussion started by: prakashreddy
1 Replies

7. Shell Programming and Scripting

Help in writing a script

Hey everyone Can anyone please write me a script to display numbers in descending order dynamically i.e if the user enter a number say 100 then the output should be like 100 99 ....so on till 0 I tried using the logic as for ((i =1; i<=100; i--) but the it goes into a infinite loop since even the... (7 Replies)
Discussion started by: icchi
7 Replies

8. Shell Programming and Scripting

Writing Bash shell scripts corresponding to windows bat files

Experts, I am newbie in shell scripting. I want to write Bash shell scripts corresponding to windows bat files. I have installed cygwin at c:\cygwin and i am trying to crate the sh file using vi editor. i am not able to understand how to use linux/unix convention for the code. following is my... (15 Replies)
Discussion started by: rajuchacha007
15 Replies

9. Shell Programming and Scripting

I need help writing this script

:wall: Can't seem to figure out how to fix this please help its not starting over like I would like it to When I enter in "Date" or "Time" nothing comes Also if you can tell me the commands for the other 3 stuff that would be much appreciated #!/bin/bash clear while ; do echo... (8 Replies)
Discussion started by: nowruzr
8 Replies
HTML::Microformats::Format::adr(3pm)			User Contributed Perl Documentation		      HTML::Microformats::Format::adr(3pm)

NAME
HTML::Microformats::Format::adr - the adr microformat SYNOPSIS
use Data::Dumper; use HTML::Microformats::DocumentContext; use HTML::Microformats::Format::adr; my $context = HTML::Microformats::DocumentContext->new($dom, $uri); my @adrs = HTML::Microformats::Format::adr->extract_all( $dom->documentElement, $context); foreach my $adr (@adrs) { print Dumper($adr->data) . " "; } DESCRIPTION
HTML::Microformats::Format::adr inherits from HTML::Microformats::Format. See the base class definition for a description of property getter/setter methods, constructors, etc. MICROFORMAT
HTML::Microformats::Format::adr supports adr as described at <http://microformats.org/wiki/adr>, with the following additions: o 'type' property This module is used by HTML::Microformats::Format::hCard to handle addresses within the hCard microformat. hCard addresses include a 'type' property indicating the address type (e.g. home, work, etc). This module supports the 'type' property whether or the address is part of an hCard. o Embedded geo microformat If an instance of the geo microformat is found embedded within an address, that geographic location will be associated with the address. RDF OUTPUT
Data is returned using the W3C's vCard vocabulary (<http://www.w3.org/2006/vcard/ns#>) and occasional other terms. Like how HTML::Microformats::Format::hCard differentiates between the business card and the entity represented by the card, this module differentiates between the address and the location represented by it. The former is an abstract social construction, its definition being affected by ephemeral political boundaries; the latter is a physical place. Theoretically multiple addresses could represent the same, or overlapping locations, though this module does not generate any data where that is the case. Where possible, the module uses Locale::Country to determine the two letter ISO code for the country of the location, and include this in the RDF output. BUGS
Please report any bugs to <http://rt.cpan.org/>. SEE ALSO
HTML::Microformats::Format, HTML::Microformats, HTML::Microformats::Format::hCard, HTML::Microformats::Format::geo. AUTHOR
Toby Inkster <tobyink@cpan.org>. COPYRIGHT
Copyright 2008-2011 Toby Inkster This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. DISCLAIMER OF WARRANTIES
THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. perl v5.14.2 2011-12-06 HTML::Microformats::Format::adr(3pm)
All times are GMT -4. The time now is 10:44 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy