I have a script which uses cli curl to download the source code of a webpage and then tests if a specific string exists in the source.
The problem is that the website has a slow response, so the eval expression hasn't completed when the test starts.
The test returns a negative, and the curl completes right after the test and changes the source.html. The test should have been positive, but ran too soon.
How do I make the test wait until curl has finished? Do I have to sleep for a few seconds, or is there another way?
The curl progress line is still showing after the test has been completed.
---------- Post updated at 11:54 PM ---------- Previous update was at 11:50 PM ----------
If I put
into the string it still doesn't work. The script has already completed when I receive the source a few seconds later.
Hi,
I want to bundle if statements
The script which i created is
if ]; then
if ]; then
now=`TZ=CST+24 date +%Y-%m-%d`
nows=`TZ=CST+24 date +%Y-%m-%d` ;
else ]; then
now=`TZ=CST+48 date +%Y-%m-%d`
nows=`TZ=CST+48 date +%Y-%m-%d` ;
fi
now=`TZ=CST+24 date +%Y-%m-%d`
nows=`date... (2 Replies)
Dear friends,
I am trying to prepare a shell script which do the following task. Being a beginner in scripting I need a bit of help from you all for shell script which does the following job.
1.Check for existence of a file in a shared directory (at some remote location ) once in a day ... (1 Reply)
Hi
I have a script that carries out a "grep" command, and displays the output on screen.
What I need to do is utilise the exit status of this grep, so that, for example, if it returns no entries, it asks the user if they want to set up a new user, and if the grep returns an entry, it states... (1 Reply)
Hi Guys,
I have one requirement like if we run install.sh file it should have to create a zone and install oracle in that zone with out any user interaction. So the complete code should be automated.
Almost 90% of the code I completed but i am having some doubts
1) After the zone creation... (1 Reply)
Hi
I am new to PHP.
I have to changed a website design adn add certain features and lnks which shuld direct it towards other website.
Can any body help me how to proceed. I have some already made templates to do this. I am conpletely new..
So, I have to first install Php from... (0 Replies)
I'm writing a small socket program (UDP) to communicate between two servers.
Problem is, I dont know how to implement time out hence my script keeps on waiting for the peer response.
#!/usr/bin/bash
use IO::Socket::INET;
$|=1;
$socket=new IO::Socket::INET->new(LocalPort=>5001,
... (2 Replies)
Hi there,
Say I have a list of IPs, I am running scripts on them. If the process hang.
I want to continue with the rest of the IPs.
10.11.1.1
10.11.1.2
10.11.1.3
10.11.1.4
10.11.1.5
10.11.1.6 <-- Process Hangs here
10.11.1.7
10.11.1.8
10.11.1.9
10.11.1.10
10.11.1.11
10.11.1.12
... (11 Replies)
Discussion started by: alvinoo
11 Replies
LEARN ABOUT MOJAVE
curlopt_tcp_keepintvl
CURLOPT_TCP_KEEPINTVL(3) curl_easy_setopt options CURLOPT_TCP_KEEPINTVL(3)NAME
CURLOPT_TCP_KEEPINTVL - set TCP keep-alive interval
SYNOPSIS
#include <curl/curl.h>
CURLcode curl_easy_setopt(CURL *handle, CURLOPT_TCP_KEEPINTVL, long interval);
DESCRIPTION
Pass a long. Sets the interval, in seconds, that the operating system will wait between sending keepalive probes. Not all operating systems
support this option. (Added in 7.25.0)
DEFAULT
60
PROTOCOLS
All
EXAMPLE
CURL *curl = curl_easy_init();
if(curl) {
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com");
/* enable TCP keep-alive for this transfer */
curl_easy_setopt(curl, CURLOPT_TCP_KEEPALIVE, 1L);
/* set keep-alive idle time to 120 seconds */
curl_easy_setopt(curl, CURLOPT_TCP_KEEPIDLE, 120L);
/* interval time between keep-alive probes: 60 seconds */
curl_easy_setopt(curl, CURLOPT_TCP_KEEPINTVL, 60L);
curl_easy_perform(curl);
}
AVAILABILITY
Always
RETURN VALUE
Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
SEE ALSO CURLOPT_TCP_KEEPALIVE(3), CURLOPT_TCP_KEEPIDLE(3),
libcurl 7.54.0 January 02, 2017 CURLOPT_TCP_KEEPINTVL(3)