-2

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 {}?

bull
  • 61
  • As the fine manual tells you, find will put the found filename where it sees {}. Not clear if you want the file.txt in your command but it is not definitely wrong. – icarus Sep 28 '20 at 19:18

1 Answers1

-2

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

bull
  • 61
  • 1
    This will execute 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