you are viewing a single comment's thread
view the rest of the comments
[–] 22 points 11 months ago (2 children)

ed and sed arre different things. One edits files in place, interactively. The other edits streams i.e.batch processing.

ed is the precursor to vi. Similar commands. It's just you can only work on one line at a time.

  • source
  • parent
  • hideshow 2 child comments
  • [–] 19 points 11 months ago (1 child)

    One edits files in place, interactively. The other edits streams i.e.batch processing.

    You want sed -i -f -

    ed is also the precursor of sed, and of some other dozen of commands.

  • source
  • parent
  • hideshow 1 child comment
  • [–] 5 points 11 months ago

    Yes ed begat sed, but sed works differently. It didn't replace ed. It did a different job.

    Ed loads the file into a buffer which you edit in a random access fashion and then save. Sed collects a list of commands and then streams the file line by line, executing the commands as they match lines. In your example nothing happens until you've entered the whole editing script.

  • source
  • parent