If I want to perform some commands given variables aren't set I'm using:
if [[ -z "$a" || -z "$v" ]] then echo "a or b are not set" fi
Yet the same syntax doesn't work with
-v, I have to use:
if [[ -v a && -v b ]] then echo "a & b are set" fi
What is the history behind this? I don't understand why the syntax wouldn't be the same. I've read that
-v is a somewhat recent addition to bash (4.2)?