Sponsored Content
Full Discussion: Network related script
Top Forums Shell Programming and Scripting Network related script Post 302914792 by Chubler_XL on Thursday 28th of August 2014 12:25:12 AM
Old 08-28-2014
You could try something like this:

Code:
#!/bin/bash

upcnt=0
downcnt=0
for ip in 192.168.1.{3..19}
do
   if ping -c 1 -W 1 $ip > /dev/null
   then
        let upcnt=upcnt+1
        uplist="$uplist\n    $ip"
   else
        let downcnt=downcnt+1
        downlist="$downlist\n    $ip"
   fi
done

printf "$upcnt ips are available:$uplist\n"
printf "$downcnt ips are not available:$downlist\n"

Note: if not response from a server it will wait up to 1 second to be sure server is unreachable - so maximum runtime should be close to 17 seconds.
This User Gave Thanks to Chubler_XL For This Post:
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Model script related question

Hey fellow bit pushers, I have been seeing an odd problem on a few of my systems and was wondering if any of you have seen it on your systems and possibly know why it happens. We have a custom model script for a printer on our systems. This model script is just a standard ksh script... (2 Replies)
Discussion started by: TioTony
2 Replies

2. Shell Programming and Scripting

shell script related to server

I want to run a shell script in such a manner so that if i will run that script on one place than changes related to that will reflect on all the servers in which i want.Is it possible to write such kind of script?Please respond me as early as possble because it is very urgent for me. (2 Replies)
Discussion started by: nitiwari
2 Replies

3. Shell Programming and Scripting

shell script related query

Hi I have an input to a file. I want the script to return it formatted the input is a number, say , 1234567895 and the output should be 21 43 65 87 59 ,ie, the pair of two digits should be reversed. How can I do this using a shell script? (1 Reply)
Discussion started by: gopsman
1 Replies

4. Solaris

Solaris 10 network, process, database related comands

Hi everbody, Can anyone let me know the resources for list of network, process, database related commands of solaris10 possibly with little bit of explanation. Thanks in advance, Chandra Sekhar. (1 Reply)
Discussion started by: chandoo.java
1 Replies

5. UNIX for Dummies Questions & Answers

script to kill related processes

hi guys, can anyone help me out with the script to kill all the related process at once. i have something like below ps -fu UID PID PPID C STIME TTY TIME CMD xyz 17398 1 2 Dec30 ? 00:31:20 ./psa_mux -simulate -client_ports 22000 xyz 17399 1 2... (2 Replies)
Discussion started by: smithaph
2 Replies

6. Shell Programming and Scripting

Problem related to shell script

I am new in shell script.I want to write a shell script to read username and password from file and compare it with the username and password which is entered by the GUI application. (1 Reply)
Discussion started by: shubhig15
1 Replies

7. AIX

Network related errors

Hi How to check if my AIX server has any network related errors ? (2 Replies)
Discussion started by: samsungsamsung
2 Replies

8. Shell Programming and Scripting

Query related to ftp script

Hi, I was planning to write a FTP script that will FTP files to destination folder. All configuration should be done through a properties files, I have developed two files under /home/499633/scripts) scripts folder, and my main file(ftp_script.sh) should read the properties from the properties... (2 Replies)
Discussion started by: rahul125
2 Replies

9. Shell Programming and Scripting

need downloading related help...but its not related to unix

Hi All, I am trying to dowmload the zip file "zkManageCustomers.zip " but i dont have access. Can anyone help me to download this file See the below link- http://www.ibm.com/developerworks/opensource/library/wa-aj-open/index.html?ca=drs- Please help me as early as... (1 Reply)
Discussion started by: aish11
1 Replies

10. Emergency UNIX and Linux Support

Network related issues

Oflate we are finding a few servers experiencing severe slowness. What would be the commands that I need to try to postmortem the situation? (3 Replies)
Discussion started by: ggayathri
3 Replies
platform::shell(n)					       Tcl Bundled Packages						platform::shell(n)

__________________________________________________________________________________________________________________________________________________

NAME
platform::shell - System identification support code and utilities SYNOPSIS
package require platform::shell ?1.1.4? platform::shell::generic shell platform::shell::identify shell platform::shell::platform shell _________________________________________________________________ DESCRIPTION
The platform::shell package provides several utility commands useful for the identification of the architecture of a specific Tcl shell. This package allows the identification of the architecture of a specific Tcl shell different from the shell running the package. The only requirement is that the other shell (identified by its path), is actually executable on the current machine. While for most platform this means that the architecture of the interrogated shell is identical to the architecture of the running shell this is not generally true. A counter example are all platforms which have 32 and 64 bit variants and where a 64bit system is able to run 32bit code. For these running and interrogated shell may have different 32/64 bit settings and thus different identifiers. For applications like a code repository it is important to identify the architecture of the shell which will actually run the installed packages, versus the architecture of the shell running the repository software. COMMANDS
platform::shell::identify shell This command does the same identification as platform::identify, for the specified Tcl shell, in contrast to the running shell. platform::shell::generic shell This command does the same identification as platform::generic, for the specified Tcl shell, in contrast to the running shell. platform::shell::platform shell This command returns the contents of tcl_platform(platform) for the specified Tcl shell. KEYWORDS
operating system, cpu architecture, platform, architecture platform::shell 1.1.4 platform::shell(n)
All times are GMT -4. The time now is 11:09 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy