#!/bin/bash LOGFILE=log.txt logcmd () { eval echo "command: \"$@\"" >> $LOGFILE; eval $@ >> $LOGFILE } logcmd touch foo\ file