I am trying to use variables to direct program output to different locations based on some user config settings.
if [ -f "vars/debug.var" ]; then
DUMP=''
else
DUMP='&> logs/dump.log'
fi
...
ping -I eth0 -c 10 www.google.com $DUMP
...
So, if the file debug.var exists, DUMP is an empty string, but if it does not exist I want to pipe the output to the dump.log file.
I have tried a lot of different combinations of the variable and command and nothing has worked out... I keep getting the error
ping: unknown host &>
Anybody have an idea? Or is it just not possible?