pass command with stdout to a bash function

view story

http://serverfault.com – ok.. this is the deal. i have a bash script like the following. the script is only to show you what i mean .. it may look strang... but is exactly what i need.: #/bin/bash runcommand () { message="$1" shift echo "$message" $* > /tmp/logfile if [ $? -gt 1 ]; then cat /tmp/logfile fi } runcommandwrapper () { wrapperoptions="$1" shift $* } this works runcommand "running command mount" mount this does not work runcommand "running command fdisk" fdisk > /tmp/fdiskoutput and this is my second question which does not work either runcommandwrap (HowTos)