I am using a Korn Shell script..
I need to verify the length of a variable..
ie number=12345
I need then to check 12345 to make sure its no longer than 5 digits...
Can you help?
I am using a Korn Shell script..
I need to verify the length of a variable..
ie number=12345
I need then to check 12345 to make sure its no longer than 5 digits...
Can you help?
how about wc -c
The lenght (number of characters) in a variable for a variable called "varname" is
echo "length is ${#varname}"
And a third way to do it is using the expr command
expr length $varname
Peace
ZB
Thanks folks - Just couldnt remember how to do it...