I've been trying to replace the content of a file with {} with a command.
The thing is that I want to do that if the file hasn't been changed since 6am so I'm using this command :
sudo find /path/to/file -type f ! -newermt '06:00:00' -exec echo "{}" > '/path/to/file' \;
The problem is that with the find command the {} are replaced with the path of the file that has been found, and I tried using quotes, or doube quotes or anti-slash but I can't get it to work properly...
Does anybody know the correct syntax ?
Thanks