Sponsored Content
Full Discussion: Ping scripting
Top Forums Shell Programming and Scripting Ping scripting Post 303024378 by Jeffm0342 on Sunday 7th of October 2018 01:28:30 PM
Old 10-07-2018
This is perfect! Another way of looking at it certainly does the trick sometimes. I created a new servers.sh script and placed those three lines in it for testing purposes, it consistently returns correct results. It's amazing how you can go from a bunch of if statements to just three lines of code. Thank you so much for such a great response.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

scripting guru's pls help me with scripting on AIX

can someone pls help me with the script for a files coming from one system to a particular directory and i want to write a script to move those files to another directory on different system by renaming the files... pls someone help me on this... thanking in anticipation.... (1 Reply)
Discussion started by: thatiprashant
1 Replies

2. UNIX for Advanced & Expert Users

can't ping IP

hi , i have problem that i can't ping machine , machine is in running state but i can't access or ping it .. but when i restarts that machine it works fine. can anybody have an idea abou this problem .. thanks (1 Reply)
Discussion started by: tahir23
1 Replies

3. Shell Programming and Scripting

Call Shell scripting from Perl Scripting.

Hi How to call a shell scripting through a Perl scripting? Actually I need some value from Shell scripting and passes in the Perl scripting. So how can i do this? (2 Replies)
Discussion started by: anupdas
2 Replies

4. What is on Your Mind?

Shell scripting vs Perl scripting

Hi all, I would like to start developping some good scripting skills. Do you think it would be best to start with shell scripting or Perl? I already got a fundation, really basics, in perl. but I am wondering what would be best to be good at first. Can you please help me determine which one to... (14 Replies)
Discussion started by: Pouchie1
14 Replies

5. What is on Your Mind?

Shell Scripting vs Perl scripting

Gents, I have been working in a Solaris/Unix environment for about 9 months. I took some linux classses online before getting the job. But, I am not very good at scripting. I want to learn how to script. Do you think that I should start with Shell scripting or Perl? I wanted to continue with... (2 Replies)
Discussion started by: Pouchie1
2 Replies

6. Web Development

Perl scripting or shell scripting?

i am going to study any one of the scripting languages mentioned above(shell 0r perl scripting) . Which is having more scope for a fresher? (1 Reply)
Discussion started by: Anna Hussie
1 Replies

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

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. Shell Programming and Scripting

Scripting with arguments for ping command

This is the script I already have but I have problems with two arguments the first argument -t , I want to count 200 by the last digit of the IP address for example when I run the script ./ping.sh -t 17, the output would be192.168.0.217 is upThe second arguments --up won't work. Could anybody... (1 Reply)
Discussion started by: Roggy
1 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
vc(1)							      General Commands Manual							     vc(1)

Name
       vc - version control program

Syntax
       vc [-a] [-t] [-cchar] [-s] [keyword=value... keyword=value]

Description
       The  command  copies lines from the standard input to the standard output under control of its arguments and control statements encountered
       in the standard input.  In the process of performing the copy operation, user declared keywords may be replaced by their string value  when
       they appear in plain text and/or control statements.

       The  copying  of  lines from the standard input to standard output is conditional.  It is based on tests (in control statements) of keyword
       values specified in control statements or as command arguments.

       A control statement is a single line beginning with a control character, except as modified by the -t keyletter (see below).   The  default
       control character is colon (:), except as modified by the -c keyletter (see below).  Input lines beginning with a backslash () followed by
       a control character are not control lines and are copied to the standard output with the backslash removed.  Lines beginning with  a  back-
       slash followed by a noncontrol character are copied in their entirety.

       A  keyword  is  composed of 9 or fewer alphanumerics; the first must be alphabetic.  A value is any ASCII string that can be created with A
       numeric value is an unsigned string of digits.  Keyword values should contain blanks or tabs.

       Replacement of keywords by values occurs whenever a keyword surrounded by control characters is encountered on a version control statement.
       The  -a keyletter (see below) forces replacement of keywords in all lines of text.  An uninterpreted control character may be included in a
       value by preceding it with .  If a literal  is desired, then it too must be preceded by .

Options
       Keyletter arguments:

       -a Replaces the keywords surrounded by control characters in all text lines.

       -cchar
	  Specifies a control character to be used in place of :.

       -s Suppresses all warning messages.

       -t Ignores all characters from the beginning of the line to the first tab character.  If one is found, all characters up to  and  including
	  the tab are discarded.

Version Control Statements:
       :dcl  keyword[, ..., keyword]
	    Used to declare keywords.  All keywords must be declared.

       :asg keyword=value
	    Used  to  assign  values to keywords.  An asg statement overrides the assignment for the corresponding keyword on the command line and
	    all previous asg's for that keyword.  Keywords declared, but not assigned values have null values.

       :if condition
	    .
	    .
	    .
       :end
	    Used to skip lines of the standard input. If the condition is true all lines between the if statement and the matching  end  statement
	    are  copied  to  the  standard  output.  If the condition is false, all intervening lines are discarded, including control statements.
	    Note that intervening if statements and matching end statements are recognized solely for the purpose of maintaining the proper if-end
	    matching.
	    The syntax of a condition is:

	     <cond>  ::= [ "not" ] <or>
	     <or>    ::= <and> | <and> "|" <or>
	     <and>   ::= <exp> | <exp> "&" <and>
	     <exp>   ::= "(" <or> ")" | <value> <op> <value>
	     <op>    ::= "=" | "!=" | "<" | ">"
	     <value> ::= <arbitrary ASCII string> | <numeric string>

	    The available operators and their meanings are:

	       =      equal
	       !=     not equal
	       &      and
	       |      or
	       >      greater than
	       <      less than
	       ( )    used for logical groupings
	       not    may only occur immediately after the if, and
		      when present, inverts the value of the
		      entire condition

	    The  >  and  < operate only on unsigned integer values.  For example, : 012 > 12 is false).  All other operators take strings as argu-
	    ments.  For example, fB: 012 != 12 is true).  The precedence of the operators (from highest to lowest) is:
	       = != > <      all of equal precedence
	       &
	       |
	    Parentheses can be used to alter the order of precedence.
	    Values must be separated from operators or parentheses by at least one blank or tab.

       ::text
	    Used for keyword replacement on lines that are copied to the standard output.  The two leading control  characters	are  removed,  and
	    keywords  surrounded  by  control  characters  in text are replaced by their value before the line is copied to the output file.  This
	    action is independent of the -a keyletter.

       :on

       :off
	    Turn on or off keyword replacement on all lines.

       :ctl char
	    Change the control character to char.

       :msg message
	    Prints the given message on the diagnostic output.

       :err message
	    Prints the given message followed by:
		 ERROR: err statement on line ... (915)
	    on the diagnostic output.  The command halts execution, and returns an exit code of 1.

Diagnostics
       Use for explanations.

Exit Codes
       0 - normal
       1 - any error

																	     vc(1)
All times are GMT -4. The time now is 05:16 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy