Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

12
  • 3
    Please add at least one script you are using. Commented Aug 30, 2021 at 10:29
  • Is there a reason you couldn't simply use ed? Commented Aug 30, 2021 at 10:31
  • 2
    "could I stack several replacements into the same sed command?" suggests that you're repeatedly running sed -i on the same file. Yes, you should add all the -e commands you want into a single sed invocation (or even into a sed script file - see sed -f). Commented Aug 30, 2021 at 10:32
  • @TobySpeight ed would potentially also use temporary files. Commented Aug 30, 2021 at 11:03
  • 1
    sed -i does not take a long time to run due to creating temporary files. It takes a long time to run because you're executing it in a tight loop. Please show what you are actually doing. Commented Aug 30, 2021 at 11:36