Sorry, I don't think I was clear. I posted the bash script I had made because I know bash just a little better than ksh. In my ksh script, I have #!/bin/ksh at the top, so I have:
Code:
#!/bin/ksh
A="stuff"
B="more stuff"
if [[ -n $A && -n $B ]]; then
echo "A is set to $A and B is set to $B"
else
echo "A or B is not set"
fi
and it returns
Code:
[[: ./test.sh expression syntax error
A or B is not set
as apparently bash and ksh treat test differently?
More specifically, I am using the MKS toolkit which installs ksh, csh, tcl shell, and other stuff to run in windows.
edit:
apparently it is this toolkit I am using, because I just installed ksh on my gentoo laptop and ran the script in ksh, and it runs as expected, but when ran from the toolkit's korn shell, the if test fails and outputs:
Code:
[[: ./test.sh expression syntax error
A or B is not set
Yet, if I test just one variable, it will run as expected.