# main element=$(eval echo \$$pathvar | colon2line | grep -x "$dirname") if [ "$element" = "" ] then # $dirname is not currently in pathvar so # add it eval eval $pathvar=$COMMAND fi