Im trying to use -exec to invoke a sed statement below:
find '$path' -mtime +$daysold -exec sed -E -f redact.sed file.txt {} \;.
what does {} do? and what goes inside {}?
Im trying to use -exec to invoke a sed statement below:
find '$path' -mtime +$daysold -exec sed -E -f redact.sed file.txt {} \;.
what does {} do? and what goes inside {}?
it should be find "$path" -mtime +$daysold -exec sed -E -f redact.sed file.txt \;
and put $path in " " instead of the ' ', also remove the braces
sed -E -f redact.sed on the same file.txt once for each matching file found - while syntactically valid, it's hard to see a practical reason to do that
– steeldriver
Sep 28 '20 at 19:46
findwill put the found filename where it sees{}. Not clear if you want thefile.txtin your command but it is not definitely wrong. – icarus Sep 28 '20 at 19:18