This contains the positive and negative logic
--
In RedHat you would need ping -c 1 to stop after one sample.
But testing a service like ssh is safer than ping, and can even deliver something useful.
I'm receiving an exit code 64 in our batch scheduler (BMC product control-m) executing a PERL script on UX-HP. Can you tell me where I can find a list of exit codes and their meaning. I'm assuming the exit code is from the Unix operating system not PERL. (3 Replies)
I have a shell script with options, one of which should exit the system (logout), however when I select this option it drops down to shell, is there a command other than exit that will close the session completely ? (1 Reply)
I'm new to Linux. I have a bash script that invokes an executable. I'd like use the SCRIPT command inside the script and exit out of the script command after it writes to the file. Does this make sense? Below is an example of the contents of my script.
#BEGIN SCRIPT
script typescript... (6 Replies)
Hi.
I am trying to extract the output of the first few lines of a continuos sh script.
The when i run it, i wont to grep the the first 20 lines of it for an entry and basically do a crtl z out of it or to that effect, and output the results to a text file.
I basically want to script... (5 Replies)
I need help in the following script. I want to grep the sql errors insert into the error table and exit the shell script if there is any error, otherwise keep running the scripts.
Here is my script
#!/bin/csh -f
source .orapass
set user = $USER
set pass = $PASS
cd /opt/data/scripts
echo... (2 Replies)
HI,
I have a file serverlist in that all host names are placed.
i have written a small script
#./testping
#! /bin/bash
for i in `cat serverlist`
do
ping $i >> output.txt
done
so now it creates a file output.txt till here fine..
now each time i run this script the output file... (4 Replies)
Hi all,
I have a shell script inside which i am executing another shell script. In the inner script im executing a command. i want the status of that command in the outer script to perform some validations.
How to get its status please help!!1
Im using ksh. (2 Replies)
hi,
i want to pop up an alert box using perl script. my requirement is.
i am using a html page which calls a perl script. this perl script calls a shell script.. after the shell script ends its execution, i am using exit 0 to terminate the shell script successfully and exit 1 to terminate the... (3 Replies)
I am invoking java program from shell script. Is there way to catch internal error and exit from script.
though it is logging exceptions and errors script continues. (2 Replies)
Discussion started by: sushma123
2 Replies
LEARN ABOUT PHP
mysqli_ping
MYSQLI_PING(3) 1 MYSQLI_PING(3)mysqli::ping - Pings a server connection, or tries to reconnect if the connection has gone down
Object oriented style
SYNOPSIS
bool mysqli::ping (void )
DESCRIPTION
Procedural style
bool mysqli_ping (mysqli $link)
Checks whether the connection to the server is working. If it has gone down, and global option mysqli.reconnect is enabled an automatic
reconnection is attempted.
This function can be used by clients that remain idle for a long while, to check whether the server has closed the connection and recon-
nect if necessary.
PARAMETERS
o $
link -Procedural style only: A link identifier returned by mysqli_connect(3) or mysqli_init(3)RETURN VALUES
Returns TRUE on success or FALSE on failure.
EXAMPLES
Example #1
mysqli::ping example
Object oriented style
<?php
$mysqli = new mysqli("localhost", "my_user", "my_password", "world");
/* check connection */
if ($mysqli->connect_errno) {
printf("Connect failed: %s
", $mysqli->connect_error);
exit();
}
/* check if server is alive */
if ($mysqli->ping()) {
printf ("Our connection is ok!
");
} else {
printf ("Error: %s
", $mysqli->error);
}
/* close connection */
$mysqli->close();
?>
Procedural style
<?php
$link = mysqli_connect("localhost", "my_user", "my_password", "world");
/* check connection */
if (mysqli_connect_errno()) {
printf("Connect failed: %s
", mysqli_connect_error());
exit();
}
/* check if server is alive */
if (mysqli_ping($link)) {
printf ("Our connection is ok!
");
} else {
printf ("Error: %s
", mysqli_error($link));
}
/* close connection */
mysqli_close($link);
?>
The above examples will output:
Our connection is ok!
PHP Documentation Group MYSQLI_PING(3)