I have the following simple script (test and do):
#!/bin/bash if [ "$TDOCONF" = "y" ]; then "$@" else echo "(tdo:) $@" finow if
$TDOCONFis not set to "y", then it echoes its arguments. If not, it does them. Note that it must be exported via
export TDOCONF=yfor 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.