I use find to get the path to my directory and I want to use sed to redact ALL the files under the directory that have been modified more than n days
I run this:
find "$path" -type f -mtime +$days -exec sed -i.bak -E -f redact.sed {} \;.
$path: path to current directory.
$days number of days since lost modified.
What is wrong with this? More specifically, I don't know what to put after redact.sed to get it to run all files under the directory.
sed -i.bak -E -f redact.sed redact.sed- running the sed script on itself could be a problem. – rowboat Sep 29 '20 at 03:26redact.sedtwice? – bull Sep 29 '20 at 03:49$pathand$days? Btw,$pathis an unfortunate name for a variable, as it can be easily confused with$PATH. – rexkogitans Sep 29 '20 at 06:28$daysis 2 and$pathto be user/file/redact – bull Sep 29 '20 at 06:53