Conditional echo/eval

I have the following simple script (test and do):


if [ "$TDOCONF" = "y" ]; then
    echo "(tdo:) $@"
now if $TDOCONF is not set to "y", then it echoes its arguments. If not, it does them. Note that it must be exported via export TDOCONF=y for the script to see it.

This makes it easy with loops over files to check what they will do, then run them, without having to edit echo commands in and out of them.