add shell option to global unless and onlyif

This should close #1777