Hi,
I face some problem with handling of nulls. I declare a variable - say i - and intialise to 0. Later I read it from console, wherein if I dont give any variable and press return key, I get this error:
"0403-004 Specify a parameter with this command"
You can also default your variables using the builtins in Korn.
${parameter:-word}
- If parameter is null or unset, word is substituted for parameter.
The value of parameter does not change.
${parameter:=word}
- If parameter is null or unset, parameter is set to the value of word.
${parameter:?message}
- If parameter is null or unset, message is printed to standard error.
This checks that variables are set correctly.
${parameter:+word}
- If parameter is set, word is substituted for parameter.
The value of parameter does not change.