Sponsored Content
Full Discussion: IP Ping Sweep
Top Forums Shell Programming and Scripting IP Ping Sweep Post 302902914 by sudo on Thursday 22nd of May 2014 07:49:38 PM
Old 05-22-2014
Quote:
Originally Posted by Chubler_XL
Well you could always assign your variable from reply after calling the function.

Or here is a change that adds a 2nd parameter for the variable to store the result.

Code:
function get_three_quad
{
   REPLY=""
   while [ -z "$REPLY" ]
   do
      printf "$1"
      read     
      if ! echo "$REPLY" | grep -qE "^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(\.|$)){3}$"
      then
         echo "Illegal input"
         REPLY=""
      fi
    done
    [ $# -gt 1 ] && printf -v "$2" "%s" "$REPLY"
}

get_three_quad "
Enter first three quadrants of router address (must contain three periods)
Example- xx.xxx.xx. : " PT1ADD
echo "You entered: $PT1ADD"

ah! That was the missing piece to the puzzle. Thanks for your help.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

ping -t

I need a script that recieves an IP adress and a number of seconds as arguments. and display a massage if the IP replies or not. (8 Replies)
Discussion started by: jaber87
8 Replies

2. UNIX for Dummies Questions & Answers

Ping

Hi , I have one system installed on Linux Red Hat 3.0. I have ip of system 3.156.168.*** and i want to ping some port that is on this IP which command i can do this? sam70 (1 Reply)
Discussion started by: sam70
1 Replies

3. Linux

Not able to ping

Hi All, Need your help one more time. I am trying to ping a linux machine which is not responding to ping. However traceroute can reach the machine and I can log in to it by ssh. I have checked /proc/sys/net/ipv4/icmp_echo_ignore_all it is already set as "0". It is not happening in the... (1 Reply)
Discussion started by: ailnilanjan
1 Replies

4. IP Networking

Can't Ping

I have an old MP-Ras Unix system. I have setup netowkring but am unable to ping any local network pcs or the default gateway. If i use the arp -a command I receive the correct mac address for all connected pcs but I cannot ping anything except the local address. Any help would be appreciative. ... (7 Replies)
Discussion started by: Rutgerncas
7 Replies

5. Shell Programming and Scripting

Animation Ping on Solaris Like Cisco Ping

Hi, I develop simple animation ping script on Solaris Platform. It is like Cisco ping. Examples and source code are below. bash-3.00$ gokcell 152.155.180.8 30 Sending 30 Ping Packets to 152.155.180.8 !!!!!!!!!!!!!.!!!!!!!!!!!!!!!. % 93.33 success... % 6.66 packet loss...... (1 Reply)
Discussion started by: gokcell
1 Replies

6. IP Networking

PING

I am unable to ping my remote server.My server is unable to ping the same. both are able to ping the gateway. both the ip's are on same network.i use a proxy tunnel on my remote server.Help if any clues. (6 Replies)
Discussion started by: oslbhavana
6 Replies

7. UNIX for Dummies Questions & Answers

Where is PING ?

SHAME, that's all that I'm felling right now, however I'm not finding PING or either tracert in my box (Solaris 10). 1) Yes my PATH does have /usr/bin /usr/sbin # echo $PATH /opt/csw:/usr/bin:/sbin:/usr/sbin:/usr/ccs/bin:/usr/sfw/bin:/opt/csw/bin:/opt/csw/gcc2/bin:/opt/csw/bin 2) If I... (1 Reply)
Discussion started by: pxb368@motorola
1 Replies

8. Shell Programming and Scripting

How to get reason for ping failure using perls Net::Ping->new("icmp");?

Hi I am using perl to ping a list of nodes - with script below : $p = Net::Ping->new("icmp"); if ($p->ping($host,1)){ print "$host is alive.\n"; } else { print "$host is unreacheable.\n"; } $p->close();... (4 Replies)
Discussion started by: tavanagh
4 Replies

9. OS X (Apple)

A Bash Audio Sweep Generator...

This is a small program as a tester for a basic sweep generator for bandwidth testing of AudioScope.sh. This DEMO is only capable of 4KHz down to about 85Hz and back due to the low bit rate, but it is proof of concept for a much wider variant using a much higher bit rate. The file generated... (4 Replies)
Discussion started by: wisecracker
4 Replies

10. Programming

Ping test sends mail when ping fails

help with bash script! im am working on this script to make sure my server will stay online, so i made this script.. HOSTS="192.168.138.155" COUNT=4 pingtest(){ for myhost in "$@" do ping -c "$COUNT" "$myhost" &&return 1 done return 0 } if pingtest $HOSTS #100% failed... (4 Replies)
Discussion started by: mort3924
4 Replies
SWEEP(1)							       0.9.3								  SWEEP(1)

NAME
Sweep - a sound wave editor SYNOPSIS
sweep [-h] [--help] [-v] [--version] [--display display] [--ignore-failed-lock] [filename]... DESCRIPTION
Sweep is a sound wave editor. OPTIONS
Sweep accepts the following options: -h, --help Display a list of all commandline options. -v, --version Output the version info. --ignore-failed-lock Continue when attempt to lock the preferences file fails. For use when the users home directory is on an NFS file system. (possi- bly unsafe) --display display Use the designated X display. ENVIRONMENT
DISPLAY to get the default host and display number. XENVIRONMENT to get the name of a resource file that overrides the global resources stored in the RESOURCE_MANAGER property. SEE ALSO
X(1) COPYRIGHT
Copyright (C) 2000 Conrad Parker OTHER INFO
More information is available at http://sweep.sourceforge.net/ AUTHOR
Conrad Parker Version 30 Jan 2007 SWEEP(1)
All times are GMT -4. The time now is 02:36 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy