12-09-2011
Shell Script Statistics
Hi All,
I am writing a UNIX shell script for the Database Operations and wanted to take the statistics i.e. How much time my script has taken to complete the operation.
I wanted to apply the logic say: In the beginning of the script I will store the value of current date and time in some variable and then finally I will take the difference of that datetime variable from the current date and time.
I am very new to shell scripting. Can some one help me to put this logic into the shell script code.
Let me know if any new logic will hold good for my requirments.
Last edited by ambarginni; 12-09-2011 at 07:19 AM..
Reason: not clear
8 More Discussions You Might Find Interesting
1. Programming
i am currently using c functions such as getprocs and statsfs to obtain process information and filesystem information on machines running aix 4.3.3.0. (soon to be running aix5.1) is there a function available to access information similar to the information provided by a vmstat command? i also... (1 Reply)
Discussion started by: briansmith40
1 Replies
2. Shell Programming and Scripting
I have a file which contains records in the format of
2006-08-25 12:06:13|ABC|93
2006-08-25 12:45:55|ABC|203
2006-08-25 01:48:19|DEF|156
2006-08-25 01:49:09|ABC|12798
2006-08-25 02:49:59|GHL|4109
2006-08-25 03:50:50|DEF|234
where the format is "arrive time"|"message type"|"processing... (3 Replies)
Discussion started by: mpang_
3 Replies
3. UNIX for Advanced & Expert Users
Is there any way to get the file descriptor statistics of a socket file descriptor? I know that the fstat, stat system calls are for this purpose, but I want to know it there any way to get socket connection statistics for a file descriptor(like socket flags, connection type etc).
Does /proc... (3 Replies)
Discussion started by: comp_wizard07
3 Replies
4. Shell Programming and Scripting
Hi,
I am trying to capture runtime stats of a shell script (c shell). Are there system variables to call? Or should I create a date variable at the start of the script and at the end of the script? I am trying to capture the time if the script stops or ends with error.
Please help.
... (4 Replies)
Discussion started by: CKT_newbie88
4 Replies
5. Shell Programming and Scripting
Hi,
I have 3 columns in a file listed below.
X Y X/(X+Y)
1 1 0.5
1 1 0.5
4 1 0.8
1 1 0.5
6 1 0.857142857
1 1 0.5
23 1 0.958333333
Now I want to find confidence interval using the formula for each row.
(p-2 sqrt p(1-p)/(x+y), p+2... (7 Replies)
Discussion started by: Diya123
7 Replies
6. Shell Programming and Scripting
Hi All,
Thanks all for the continued support so far.
Today, I need to find the most occurring string/number(also called mode in statistics terminology) for each column in a data file (.csv type).
For one column of data(1.txt) like below
Sample
1
2
2
3
4
1
1
1
2
I can find the mode... (6 Replies)
Discussion started by: ks_reddy
6 Replies
7. Shell Programming and Scripting
Hello friends, I need a BIG help from UNIX collective intelligence:
I have a CSV file like this:
VALUE,TIMESTAMP,TEXT
1,Sun May 05 16:13:05 +0000 2013,"RT @gracecheree: Praying God sends me a really great man one day. Gotta trust in his timing.
0,Sun May 05 16:13:05 +0000 2013,@sendi__... (19 Replies)
Discussion started by: kraterions
19 Replies
8. UNIX for Advanced & Expert Users
I have a file size is around 24 G with 14 columns, delimiter with "|"
My requirement- can anyone provide me the fastest and best to get the below results
Number of records of the file
First column and second Column- Unique counts
Thanks for your time
Karti
------ Post updated at... (3 Replies)
Discussion started by: kartikirans
3 Replies
LEARN ABOUT PHP
time_sleep_until
TIME_SLEEP_UNTIL(3) 1 TIME_SLEEP_UNTIL(3)
time_sleep_until - Make the script sleep until the specified time
SYNOPSIS
bool time_sleep_until (float $timestamp)
DESCRIPTION
Makes the script sleep until the specified $timestamp.
PARAMETERS
o $timestamp
- The timestamp when the script should wake.
RETURN VALUES
Returns TRUE on success or FALSE on failure.
CHANGELOG
+--------+---------------------------------------------------+
|Version | |
| | |
| | Description |
| | |
+--------+---------------------------------------------------+
| 5.3.0 | |
| | |
| | This function is now available on Windows plat- |
| | forms. |
| | |
+--------+---------------------------------------------------+
ERRORS
/EXCEPTIONS
If the specified $timestamp is in the past, this function will generate a E_WARNING.
EXAMPLES
Example #1
A time_sleep_until(3) example
<?php
//returns false and generates a warning
var_dump(time_sleep_until(time()-1));
// may only work on faster computers, will sleep up to 0.2 seconds
var_dump(time_sleep_until(microtime(true)+0.2));
?>
NOTES
Note
All signals will be delivered after the script wakes up.
SEE ALSO
sleep(3), usleep(3), time_nanosleep(3), set_time_limit(3).
PHP Documentation Group TIME_SLEEP_UNTIL(3)