03-20-2005
conversion to interger
Hello,
I want to convert a string to interger.
Quote:
for i in $1 $2 $3 $4
do
var=int ($i)
if test $var -gt 255
then
echo INVALID
exit 0
fi
but its not working..
can anyone help me
thanks in advance
esham
10 More Discussions You Might Find Interesting
1. UNIX for Advanced & Expert Users
Dear friends,
i am writing sh shell script
I have a file containing binary data.
like this.
010101010101010101101010101010100001010101010101001.
i want to read some particular bits and convert it into decimal valuse.
example.
1.first i want to read 5 bits and convert it into... (1 Reply)
Discussion started by: rajan_ka1
1 Replies
2. UNIX for Advanced & Expert Users
Hello,
I want to convert MM DD YYYY date format to MM-DD-YYYY format.
For exemple:
I have to convert Nov 28 2005 to 28-11-2005.
Thenks for youf help.
DAFI (2 Replies)
Discussion started by: dafidak
2 Replies
3. Shell Programming and Scripting
Hi everybody:
Could anybody tell me how I convert from a julian date, with shell comands, to gregorian.
Thanks in advance. (2 Replies)
Discussion started by: tonet
2 Replies
4. Shell Programming and Scripting
hi all
i have a file like
151125
25252
2452567
253464576
255
i want this file to be like
'151125','25252','2452567','253464576','255'
please help
thanks (3 Replies)
Discussion started by: infyanurag
3 Replies
5. Shell Programming and Scripting
Hi
I want to convert MAY 05 2005 01:15:00PM date format to 2005/05/05 01:15:00PM .
CAn somebody suggest me a code ,I am new to unix shell programming.
Thanks
Arif (21 Replies)
Discussion started by: mab_arif16
21 Replies
6. Shell Programming and Scripting
How to convert Nov 10 14:20 to YYYYMMDDHHMMSS in unix
I am using K-shell HP-AUX (1 Reply)
Discussion started by: chinniforu2003
1 Replies
7. Shell Programming and Scripting
Hi,
I have a requirement to capture file time stamp and compare with current system time. I am using HP-AUX K-shell.
Below is what i have done
Getting current date into myfile2
---------------------------------
date +%Y%m%d%H%M%S > myfile2
20091110132800
Getting the file date into... (5 Replies)
Discussion started by: chinniforu2003
5 Replies
8. Shell Programming and Scripting
Hi,
I have a variable which contains json string
ex :
temp=`curl -X GET http://localhost:5984/example/$id`
now temp contains =>... (3 Replies)
Discussion started by: shams11
3 Replies
9. UNIX for Advanced & Expert Users
Hi all,
I have one libxxx.so file ( which I got from a third party ). We use shared library libxxx.sl . Is there any way to convert the .so file to .sl file ?
Thanks in advance
- M (3 Replies)
Discussion started by: kanu_kanu
3 Replies
10. Shell Programming and Scripting
Hi,
i've a code
if (($A && ((!($A =~ /^\d+$/)))))
{
-- -- not a number
}
else
{
--- its number.
}
which matches for integer value, i need to modify that pattern where it matches decimal number with 2 decimal points and also integer value.
for eg: values 10, 10.00. 0.1, 1 , 3 must... (2 Replies)
Discussion started by: asak
2 Replies
LEARN ABOUT CENTOS
cmap_dec
CMAP_DEC(3) Corosync Cluster Engine Programmer's Manual CMAP_DEC(3)
NAME
cmap_inc - Decrease already stored value in CMAP
SYNOPSIS
#include <corosync/cmap.h>
cs_error_t cmap_dec (cmap_handle_t handle, const char *key_name);
DESCRIPTION
The cmap_dec function is used to decrease integer value of already stored key inside cmap. The handle argument is connection to CMAP data-
base obtained by calling cmap_initialize(3) function. key_name is name of key to increase value of.
Function is defined only on values where increase makes sense and is well defined, so it can be one of:
CMAP_VALUETYPE_INT8 - 8-bit signed interger
CMAP_VALUETYPE_UINT8 - 8-bit unsigned integer
CMAP_VALUETYPE_INT16 - 16-bit signed interger
CMAP_VALUETYPE_UINT16 - 16-bit unsigned integer
CMAP_VALUETYPE_INT32 - 32-bit signed interger
CMAP_VALUETYPE_UINT32 - 32-bit unsigned integer
CMAP_VALUETYPE_INT64 - 64-bit signed interger
CMAP_VALUETYPE_UINT64 - 64-bit unsigned integer
Overflow/underflow is not detected and it's ignored.
RETURN VALUE
This call returns the CS_OK value if successful. If value or key_name are unspecified, CS_ERR_INVALID_PARAM is returned. CS_ERR_NOT_EXIST
error is returned if key doesn't exist (wasn't created by calling cmap_set(3) first). Some of keys may be tagged read-only directly in
corosync and seting such key will result in CS_ERR_ACCESS error.
SEE ALSO
cmap_get(3), cmap_set(3), cmap_initialize(3), cmap_overview(8)
CS_ERR_TRY_AGAIN Resource temporarily unavailable
CS_ERR_INVALID_PARAM Invalid argument
CS_ERR_ACCESS Permission denied
CS_ERR_LIBRARY The connection failed
CS_ERR_INTERRUPT System call inturrupted by a signal
CS_ERR_NOT_SUPPORTED The requested protocol/functuality not supported
CS_ERR_MESSAGE_ERROR Incorrect auth message received
CS_ERR_NO_MEMORY Not enough memory to completed the requested task
corosync Man Page 03/02/2012 CMAP_DEC(3)