Is there a simple way to determine the length of a Variable in a shell?
I am using Korn in the following example. The code can be a 1 or 2 digit A/N code but must be less than 3 digits A/N:
#!/bin/ksh
echo "Enter Code for Product: \c"
read PC
if [ -z "$PC" ]
then
echo "No code entered..."
exit 1
elif [ Here is where I want to check that $PC is less than 3 digits A/N ]
then
Do something based on whether it is 1 or 2 digits.
else # It's 3 digits or more
exit 2
fi