Sample Header Ad - 728x90

Output to variable or file using (find with -exec and shred)

3 votes
1 answer
833 views
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.
Asked by John Riordan (31 rep)
Jan 24, 2022, 09:02 PM
Last activity: Jul 26, 2024, 09:04 PM