But WorldDMT, I want to match the variable value "on" in my example, not blodix's. By not using a number, it'll only get matched for the variable itself. Besides, when you do > //echo -a $(,$+(%,warnon,#)) with a comma (marked in red) , you'll get an insufficient parameter error. Without the comma, it returns the variable name only.