#!/bin/sh export onoff=yes for f in 1 2 3 4 5 6 ; do \ if [ -z $(onoff) ] ; then echo yes unset onoff else echo no export onoff=yes fi done