Skip to Main Content
Expert Shell Scripting
book

Expert Shell Scripting

by Ron Peters
December 2008
Intermediate to advanced content levelIntermediate to advanced
320 pages
6h 45m
English
Apress
Content preview from Expert Shell Scripting

CHAPTER 25Editing Files in Place

Sometimes you want to modify a file as part of the tasks run from a shell script. Although the use of sed to modify files on the fly is common, the use of ed is less familiar to many. ed is a line-oriented editor that works much like any other text editor. It opens a file, makes modifications, saves the changes, and exits. The advantage of using ed to script these interactive sessions is that the modification is performed directly on the file itself and the results are neither redirected to another file nor used to overwrite the file itself.

For example, you might want to process a large list of files, applying a single modification to all of the files. In most of these cases, the modification may not be more ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Robust Shell Scripting

Robust Shell Scripting

Arnold Robbins
Hacker Techniques, Tools, and Incident Handling

Hacker Techniques, Tools, and Incident Handling

Sean-Philip Oriyano, Michael Gregg

Publisher Resources

ISBN: 9781430218418Purchase book