simplify condition when numbers of nested shells shall be printed