04-03-2015
It is because the ++ in count[subscript]++ is a post-increment operation. That expression returns the value it had before the value is incremented and then increments the variable to the new value. To have it return the new value (instead of the old value), you would use the pre-increment operation ++count[subscript].
This User Gave Thanks to Don Cragun For This Post:
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
set DAY=`date +%y%m%d`
set H=`date +%H`
set M=`date +%M`
mailx -s "$H-Mydata" myemail@mail.com<mydata
I am looking to set the current hour to have 1 hour less in the subject header:
For example: let's say the system time is 8
I want to have "7-Mydata" not "8-Mydata"
Can some1... (6 Replies)
Discussion started by: bobo
6 Replies
2. UNIX for Dummies Questions & Answers
My program:
__________________________________
#!/bin/ksh
DAY=`date +%y%m%d`
H=`date +%H`
M=`date +%M`
day=`date +%m/%d/%y`
let h=$H-1
echo DAY $DAY
echo H $H
echo M $M
echo day $day
echo h $h
_____________________________________
My result: (3 Replies)
Discussion started by: bobo
3 Replies
3. Shell Programming and Scripting
i have this script that checks for yesterday date and also specific hour in that
-----------------------------------------------------------------
TZ=`date +%Z`+24 ;a=`date +%Y-%m-%d %k`
cd logs
count=0
for i in DBMaint.log
do
cat $i | grep $a >> file12.txt
done... (0 Replies)
Discussion started by: ali560045
0 Replies
4. Shell Programming and Scripting
Hi i have log like this :
Actually i will process the data become
Anybody can help me ? (6 Replies)
Discussion started by: justbow
6 Replies
5. What is on Your Mind?
I had some free time at work today so I decided to get a little practice with my shell scripts (I'm pretty new to the whole UNIX thing).
I'm sure I'm not the only college student here so maybe this code will come in handy for future weekends.
#!/bin/sh
if
then
echo "No playlist... (0 Replies)
Discussion started by: thedoobieman5
0 Replies
6. Shell Programming and Scripting
I have a log like this:
Jan 26 13:59:41 server2 ntpdate: step time server 91.189.94.4 offset 0.065456 sec
Jan 26 13:59:41 server2 ntpd: ntpd 4.2.4p8@1.1612-o Fri Aug 6 22:49:54 UTC 2010 (1)
Jan 26 13:59:41 server2 ntpd: precision = 1.000 usec
Jan 26 13:59:41 server2 ntpd: ntp_io: estimated max... (2 Replies)
Discussion started by: Jotne
2 Replies
7. UNIX for Dummies Questions & Answers
Hi,
I am getting a high load average, around 7, once an hour. It last for about 4 minutes and makes things fairly unusable for this time.
How do I find out what is using this. Looking at top the only thing running at the time is md5sum.
I have looked at the crontab and there is nothing... (10 Replies)
Discussion started by: sm9ai
10 Replies
8. Shell Programming and Scripting
Hi friends, I want to convert 24 hour timing to 12 hour please help me...
my data file looks like this..
13-Nov-2011 13:27:36 15.32044 72.68502
13-Nov-2011 12:08:31 15.31291 72.69807
16-Nov-2011 01:16:54 15.30844 72.74028
15-Nov-2011 20:09:25 15.35096 ... (13 Replies)
Discussion started by: nex_asp
13 Replies
9. Shell Programming and Scripting
Hi guys
I want any script to get me next hour
For example
Nexthour.sh 2013022823
It get me result
2013030100
Thanks a lot , I'm using Solaris 10 (5 Replies)
Discussion started by: teefa
5 Replies
10. Shell Programming and Scripting
Hi All,
Thank you for reading through my post and helping me figure out how I would be able to perform this task.
For example: I have a list of continuous output collected into a file in the format as seen below:
Date...........Time........C....A......... B
==========================... (5 Replies)
Discussion started by: terrychen
5 Replies
LEARN ABOUT CENTOS
ssl_get_session
SSL_get_session(3) OpenSSL SSL_get_session(3)
NAME
SSL_get_session - retrieve TLS/SSL session data
SYNOPSIS
#include <openssl/ssl.h>
SSL_SESSION *SSL_get_session(const SSL *ssl);
SSL_SESSION *SSL_get0_session(const SSL *ssl);
SSL_SESSION *SSL_get1_session(SSL *ssl);
DESCRIPTION
SSL_get_session() returns a pointer to the SSL_SESSION actually used in ssl. The reference count of the SSL_SESSION is not incremented, so
that the pointer can become invalid by other operations.
SSL_get0_session() is the same as SSL_get_session().
SSL_get1_session() is the same as SSL_get_session(), but the reference count of the SSL_SESSION is incremented by one.
NOTES
The ssl session contains all information required to re-establish the connection without a new handshake.
SSL_get0_session() returns a pointer to the actual session. As the reference counter is not incremented, the pointer is only valid while
the connection is in use. If SSL_clear(3) or SSL_free(3) is called, the session may be removed completely (if considered bad), and the
pointer obtained will become invalid. Even if the session is valid, it can be removed at any time due to timeout during
SSL_CTX_flush_sessions(3).
If the data is to be kept, SSL_get1_session() will increment the reference count, so that the session will not be implicitly removed by
other operations but stays in memory. In order to remove the session SSL_SESSION_free(3) must be explicitly called once to decrement the
reference count again.
SSL_SESSION objects keep internal link information about the session cache list, when being inserted into one SSL_CTX object's session
cache. One SSL_SESSION object, regardless of its reference count, must therefore only be used with one SSL_CTX object (and the SSL objects
created from this SSL_CTX object).
RETURN VALUES
The following return values can occur:
NULL
There is no session available in ssl.
Pointer to an SSL
The return value points to the data of an SSL session.
SEE ALSO
ssl(3), SSL_free(3), SSL_clear(3), SSL_SESSION_free(3)
1.0.1e 2013-02-11 SSL_get_session(3)