I have a find command that I exec to shred and it works great; however, I need to capture the output of this and pass to a variable or a file. I have tried so many iterations of the below commands, but cant seem to get it to work. I also have tried for loops. It always will display to my terminal as it goes through the shred process, but never writes to a file or variable. I would prefer a variable but will take anything at this point. Please see my examples below:
Original find command:
find /burncd/working -type f -exec shred -v -n7 -z --remove {} \;
Latest try at a command to pass to a file (from StackExchange):
find /burncd/working/* -type f -exec bash -c 'shred -v -n7 -z --remove "$1" /tmp/find.out' $0 {} \;
I would appreciate any help you could give.