hi
I face the problem the if else statement dint return correct result for me
my script as below:
#!/bin/ksh
sqlplus -s /nolog <<EOF
connect databaseuser/password
column num new_value num format 9999
set head off
select count(*) num from table1;
exit num
EOF
if ; then
echo "$?"... (6 Replies)
Iam trying to compare the string in if else... but some how its not working
following is the code
On executing the above one its giving a error message ': bad number'
in the above parameter l & k are numbers and dbfiles and patchefiles are array
If i do echo ift working fine
... (2 Replies)
grep "HP_nv6005ud" mail_log.log | awk '{print $2}' >raju.log
if
then
grep "$testdate" raju.log
if
Hi in the above script $2 gives rge today date. and $ydate is yesterdays date.
not in the if condition i need to compare both the dates.
Please help me in this.
Thanks in... (7 Replies)
Can someone please help me out here?
I have strings similar to aafafaff45,29.34.942.45,edfdfafa that i want to compare to another similar string to check if they are the same. my script isn't working.
ONE="aafafaff45,29.34.942.45,edfdfafa"
TWO="ddfafagfa,87.57.942.45,afafafff"
if ONE is... (5 Replies)
I have a directory with about 6 files that we receive regularly. these 6 files contain information for 3 different units, 2 for each unit. files related to a specific unit are named similarly with a change in number at the end of the file. the numbers should be sequential. for each grouping of... (3 Replies)
Hi there,
I want to compare 2nd column which are alphanumeric values from each of the 2 files i.e.,lspv_pre.out and lspv_post.out , if found echo some message.
lspv_pre.out
hdisk0 00c39eaa451144dd rootvg active
hdisk1 00c39eaa45223322 ... (3 Replies)
HI All,
I am new to Unix shell scripts..
Could you please post the unix shell script for for the below request.,
There are two different tables(sample1, sample2) in different schemas(s_schema1, s_schema2).
Unix shell script to compare the columns of two different tables of two... (2 Replies)
Hi,
I will be having file names like below,
1420SP1.01804
1420SP1.01805D
1420SP1.01805
1420SP1.01806D
1420SP1.01806
1420SP1.01901D
1420SP1.01901
1420SP1.01902D
1420SP1.01902
1420SP1.01903D
1420SP1.01903
1420SP1.01904
1420SP1.01905
From this, I need to list file names which is... (3 Replies)
Discussion started by: Sumanthsv
3 Replies
LEARN ABOUT CENTOS
libmemcached_examples
LIBMEMCACHED_EXAMPLES(3) libmemcached LIBMEMCACHED_EXAMPLES(3)NAME
libmemcached_examples - libmemcached Documentation
Examples for libmemcached
DESCRIPTION
For full examples, test cases are found in tests/*.c in the main distribution. These are always up to date, and are used for each test run
of the library.
CONNECTING TO SERVERS
const char *config_string= "--SERVER=host10.example.com --SERVER=host11.example.com --SERVER=host10.example.com"
memcached_st *memc= memcached(config_string, strlen(config_string);
{
...
}
memcached_free(memc);
In the above code you create a memcached_st object with three server by making use of memcached_create().
CREATING A POOL OF SERVERS
Creating a pool of Servers:
const char *config_string= "--SERVER=host10.example.com --SERVER=host11.example.com --SERVER=host10.example.com";
memcached_pool_st* pool= memcached_pool(config_string, strlen(config_string));
memcached_return_t rc;
memcached_st *memc= memcached_pool_pop(pool, false, &rc);
.... do work
/*
Release the memc_ptr that was pulled from the pool
*/
memcached_pool_push(pool, memc);
/*
Destroy the pool.
*/
memcached_pool_destroy(pool);
In the above code you create a memcached_pool_st object with three server by making use of memcached_pool().
When memcached_pool_destroy() all memory will be released that is associated with the pool.
ADDING A VALUE TO THE SERVER
Adding a value to the Server:
char *key= "foo";
char *value= "value";
memcached_return_t rc= memcached_set(memc, key, strlen(key), value, value_length, (time_t)0, (uint32_t)0);
if (rc != MEMCACHED_SUCCESS)
{
... // handle failure
}
It is best practice to always look at the return value of any operation.
FETCHING MULTIPLE VALUES
memcached_return_t rc;
char *keys[]= {"fudge", "son", "food"};
size_t key_length[]= {5, 3, 4};
unsigned int x;
uint32_t flags;
char return_key[MEMCACHED_MAX_KEY];
size_t return_key_length;
char *return_value;
size_t return_value_length;
rc= memcached_mget(memc, keys, key_length, 3);
x= 0;
while ((return_value= memcached_fetch(memc, return_key, &return_key_length,
&return_value_length, &flags, &rc)))
{
free(return_value);
x++;
}
Notice that you freed values returned from memcached_fetch(). The define MEMCACHED_MAX_KEY is provided for usage.
HOME
To find out more information please check: http://libmemcached.org/
SEE ALSO memcached(1)AUTHOR
Brian Aker
COPYRIGHT
2011-2013, Brian Aker DataDifferential, http://datadifferential.com/
1.0.16 January 31, 2013 LIBMEMCACHED_EXAMPLES(3)