Hi all, I have a stupid question on NULL and zero(0).
In a script I've been working with, one of the lines is:
if [ $intchk1 == 1 ] && [ $Current_csm2 != 0 ]
then
The problem I seem to have is when $Current_csm2 is null, this if block is not triggered, and I don't get why because I was under the impression that NULL!=0
Can you give me a pointer why my code will not work? I don't mind changing code, but I'd prefer to understand why what I had to begin with did not work?
I want this if block to trigger if $intcheck == 1 and $Current_csm2 is a value other then 0, so it might be NULL or it may be 3 or it may be "foo", any of these would cause the script to exit with a specific exit code.
if $intcheck == 1 and $Current_csm2==0, I want the if block to be bypassed and the rest of the script to run.