Sponsored Content
Full Discussion: First script in a long time
Top Forums Shell Programming and Scripting First script in a long time Post 303009307 by andysensible on Tuesday 12th of December 2017 11:15:15 AM
Old 12-12-2017
$lastseen variable

what I was trying to do with the $last seen was to account for any output other then a number or null output. I guess my logic is incorrect.

Is there a way I can combine the whole curl command and part the last seen time and look for any error or null output?


Code:
elif [[ "$lastseen" = '^[a-ZA-Z]*$' ]] || [[ -z "$lastseen" ]];
echo "Serial Number Invaild"
then exit 3; 
fi

Thanks for the feedback
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

shell script takes long time to complete

Hi all, I wrote this shell script to validate filed numbers for input file. But it take forever to complete validation on a file. The average speed is like 9mins/MB. Can anyone tell me how to improve the performance of a shell script? Thanks (12 Replies)
Discussion started by: ozzman
12 Replies

2. AIX

rcp gets hung for long time

Every evening I run a script in AIX production box, which executes below command: rcp prod_bkup.tar prodapp@IP:/data/appl/prod This will rcp a backup of around 11 GB from production to another machine (runs every evening so overwrites previous one). Just to keep the backup safe. Since 2-3 days,... (0 Replies)
Discussion started by: panchpan
0 Replies

3. Programming

Debug env for long time use

Hi, I'm pritty new to C, but a recent bug in a program i've been using has forced me to debug it. But I am unable to find a debugger that can act as a layer between the OS and the program to see whats going on.. The problem is that this piece of software makes a connection through localhost... (2 Replies)
Discussion started by: nephilimbe
2 Replies

4. Shell Programming and Scripting

<AIX>Problem in purge script, taking very very long time to complete 18.30hrs

Hi, I have here a script which is used to purge older files/directories based on defined purge period. The script consists of 45 find commands, where each command will need to traverse through more than a million directories. Therefore a single find command executes around 22-25 mins... (7 Replies)
Discussion started by: sravicha
7 Replies

5. Shell Programming and Scripting

help - exec time too long

Dear everyone... thanks to this forum I am able to do everyday more and more complex scripts...but now I come up with problem with optimisation.. problem 1 - optimise: here is my code: while read number do nawk -F "|" -v... (8 Replies)
Discussion started by: abdulaziz
8 Replies

6. UNIX for Dummies Questions & Answers

Job is taking long time

Hi , We have 20 jobs are scheduled. In that one of our job is taking long time ,it's not completing. If we are not terminating it's running infinity time actually the job completion time is 5 minutes. The job is deleting some records from the table and two insert statements and one select... (7 Replies)
Discussion started by: ajaykumarkona
7 Replies

7. Shell Programming and Scripting

How long ago since time - Using perl

echo "1337124526" | perl -pe 's/(\d+)/easttime($1)/e' the above gives a date and time. how can i subtract the date and time given by this command, from the current present date? can this be a one liner or as close to a one-liner as possible? (1 Reply)
Discussion started by: SkySmart
1 Replies

8. Shell Programming and Scripting

Kill long running script, if it crosses the threshold time

Hi, I need a script to kill the process if it running for long time. Inputs for the scripts: 1.test.sh (will be running fron cron scheduler) 2.1 hr (ie threshold_time - if the test.sh is running for more than 1 hr test.sh has to kill) Thanks, Divya (1 Reply)
Discussion started by: Divya Nochiyil
1 Replies

9. Shell Programming and Scripting

Expect script idles for a long time

the following code works sometimes. other times, it behaves mysteriously. when the script sshs to a box, it is suppose to automatically begin running the command it is told to run. but in this case, after this script logs into a host, it just sits there at the prompt and does not run the... (1 Reply)
Discussion started by: SkySmart
1 Replies

10. Shell Programming and Scripting

Killing the process if running for long time in script

I am running a script which will read the data from fail line by line and call the Java program by providing the arguments from the each line. The Java code is working fast for few records and for some records its getting hanged not providing response for morethan one hour. Currently am... (4 Replies)
Discussion started by: dineshaila
4 Replies
CURLOPT_TIMEOUT(3)					     curl_easy_setopt options						CURLOPT_TIMEOUT(3)

NAME
CURLOPT_TIMEOUT - set maximum time the request is allowed to take SYNOPSIS
#include <curl/curl.h> CURLcode curl_easy_setopt(CURL *handle, CURLOPT_TIMEOUT, long timeout); DESCRIPTION
Pass a long as parameter containing timeout - the maximum time in seconds that you allow the libcurl transfer operation to take. Normally, name lookups can take a considerable time and limiting operations to less than a few minutes risk aborting perfectly normal operations. This option may cause libcurl to use the SIGALRM signal to timeout system calls. In unix-like systems, this might cause signals to be used unless CURLOPT_NOSIGNAL(3) is set. If both CURLOPT_TIMEOUT(3) and CURLOPT_TIMEOUT_MS(3) are set, the value set last will be used. Since this puts a hard limit for how long time a request is allowed to take, it has limited use in dynamic use cases with varying transfer times. You are then advised to explore CURLOPT_LOW_SPEED_LIMIT(3), CURLOPT_LOW_SPEED_TIME(3) or using CURLOPT_PROGRESSFUNCTION(3) to imple- ment your own timeout logic. DEFAULT
Default timeout is 0 (zero) which means it never times out during transfer. PROTOCOLS
All EXAMPLE
CURL *curl = curl_easy_init(); if(curl) { curl_easy_setopt(curl, CURLOPT_URL, "http://example.com"); /* complete within 20 seconds */ curl_easy_setopt(curl, CURLOPT_TIMEOUT, 20L); curl_easy_perform(curl); } AVAILABILITY
Always RETURN VALUE
Returns CURLE_OK SEE ALSO
CURLOPT_TIMEOUT_MS(3), CURLOPT_CONNECTTIMEOUT(3), CURLOPT_LOW_SPEED_LIMIT(3), libcurl 7.54.0 February 03, 2016 CURLOPT_TIMEOUT(3)
All times are GMT -4. The time now is 08:11 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy