Sponsored Content
Top Forums Shell Programming and Scripting Testing connection with a script Post 302351320 by KimJensen on Tuesday 8th of September 2009 07:04:07 AM
Old 09-08-2009
-thanks again
I do learn from this Smilie

My plan is to execute the script every minute by a cronjob that works fine. But the thing is that I made an infinite loop and I don't know how to get out of it again when the connection is up again ?
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Testing ssh connection from KSH script

Hi. I have a kornshell script that runs on a daily basis as a cron job. Part of what the script does is copy the folder contents from another server to the current server (server where KSH script is running). I have a scp command, as follows: scp $REMOTE_HOST:$REMOTE_FILE_DIR/* $TMP_DIR ... (8 Replies)
Discussion started by: dmilks
8 Replies

2. Shell Programming and Scripting

Testing VPN Connection

Hi All: I need a script that can be timed to run every half hour to an hour to run a traceroute through a VPN to test that a connection is still up from a Win XP system. Which would be the best, C++ or Perl and what are some good resources to look at. (If anyone has a script to do this... (1 Reply)
Discussion started by: maxhewitt
1 Replies

3. Solaris

Testing physical network connection

How do you test the physical network connection of an interface in solaris. I know that if you have an active connection and the cable gets yanked, you can look in the messages file to check for link failure messages. But is there any better way to see if you have good layer 2 connectivity? (1 Reply)
Discussion started by: tjlst15
1 Replies

4. Shell Programming and Scripting

Testing telnet connections in a script

Hi, I am trying to figure out how to test to see if a server is accepting telnet connections via a script. I have several remote MPE servers that are set in single user mode (and hence not accepting telnet connections), for their backups, I want to try and automate a test (from a unix... (0 Replies)
Discussion started by: dikiee
0 Replies

5. Shell Programming and Scripting

Testing a comand in the script

Hi everyone , i am new to shell scripting and am having some problem to test if this line has been executed well and display a pass message on the screen or fail if not sqlplus XXTEST/$2 <<END > $XXTEST_TOP/log/$0.log @$XXTEST_TOP/admin/sql/XXTEST_SPE1_XX_QUOTE_DETAILS_TBL.sql XXTEST$2... (2 Replies)
Discussion started by: Lutchumaya
2 Replies

6. Shell Programming and Scripting

testing a dhcp connection

Hi there, I have a computers that has a fixed address : terminal48:~# cat /etc/network/interfaces # This file describes the network interfaces available on your system # and how to activate them. For more information, see interfaces(5). # The loopback network interface auto lo iface lo... (1 Reply)
Discussion started by: chebarbudo
1 Replies

7. Solaris

Solaris 10 ftp connection problem (connection refused, connection timed out)

Hi everyone, I am hoping anyone of you could help me in this weird problem we have in 1 of our Solaris 10 servers. Lately, we have been having some ftp problems in this server. Though it can ping any server within the network, it seems that it can only ftp to a select few. For most servers, the... (4 Replies)
Discussion started by: labdakos
4 Replies

8. Shell Programming and Scripting

Package version testing script

I was wondering if anyone already had a script to check rpm packages versions x.x.x or greater. so I could do a: # CheckRpmVersion Somepackage-1.2.3 And would output: whether the package is installed or not and if it was equal to or greater than the version 1.2.3. I know I can pull out... (0 Replies)
Discussion started by: Ikon
0 Replies

9. Shell Programming and Scripting

testing postgres connection in shell script

I have a script that does db query in postgres. I'm trying to put in some error checking in the script. I keep running into the password prompt problem where when invalid credentials/or database is put it, it would prompt me for a password which hangs the script. Is there a way that I can check for... (0 Replies)
Discussion started by: zerofire123
0 Replies

10. Shell Programming and Scripting

Script Testing

Hello Scripting Czars I have written one script, which does the Openssl Connection test to 1000's of server's , but before it finally takes off , its error-ring out, kindly take a look into this. #!/bin/bash #Script to Test Connectivity withListen Address & Port Address #Script... (10 Replies)
Discussion started by: raghunsi
10 Replies
for(n)							       Tcl Built-In Commands							    for(n)

__________________________________________________________________________________________________________________________________________________

NAME
for - ``For'' loop SYNOPSIS
for start test next body _________________________________________________________________ DESCRIPTION
For is a looping command, similar in structure to the C for statement. The start, next, and body arguments must be Tcl command strings, and test is an expression string. The for command first invokes the Tcl interpreter to execute start. Then it repeatedly evaluates test as an expression; if the result is non-zero it invokes the Tcl interpreter on body, then invokes the Tcl interpreter on next, then repeats the loop. The command terminates when test evaluates to 0. If a continue command is invoked within body then any remaining commands in the current execution of body are skipped; processing continues by invoking the Tcl interpreter on next, then evaluating test, and so on. If a break command is invoked within body or next, then the for command will return immediately. The operation of break and continue are similar to the corresponding statements in C. For returns an empty string. Note: test should almost always be enclosed in braces. If not, variable substitutions will be made before the for command starts execut- ing, which means that variable changes made by the loop body will not be considered in the expression. This is likely to result in an infinite loop. If test is enclosed in braces, variable substitutions are delayed until the expression is evaluated (before each loop iter- ation), so changes in the variables will be visible. For an example, try the following script with and without the braces around $x<10: for {set x 0} {$x<10} {incr x} { puts "x is $x" } SEE ALSO
break, continue, foreach, while KEYWORDS
for, iteration, looping Tcl for(n)
All times are GMT -4. The time now is 10:13 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy