Join David D. Levine for an in-depth discussion in this video Appending, inserting, and changing entire lines with "a", "i," and "c", part of SED Essential Training.
- In this video, we'll discuss commands…that affect multiple entire lines.…"a" appends lines, "i" inserts lines, and "c" changes lines.…Every command I've shown you so far…affects only one line at a time,…but SED's "a", "i", and "c" commands…append, insert, or change…one or more entire lines at the same time.…However, SED is still inherently line-oriented,…so whenever you use these three SED commands…you must use backslash newline…to mark the beginning of the new line or lines.…
This is in addition to the fact…that if you use any of these commands…on the shell command line,…you must use quoting, or some other form of escape,…to protect the newline from the shell.…The basic "a" command appends one or more lines of text…after the single line specified by its address.…Here's how it looks in action.…On lines containing "down",…we will append a line that looks like this.…So, this "a" command has the same effect…as the "r" command we looked at earlier.…
It appends an infantile comment…after each line containing the word "down".…
AuthorDavid D. Levine
- Understanding input, output, files, and pipes
- Modifying the "s" command
- Using character classes and quantifiers
- Controlling printing
- Reading and writing files
- Appending, inserting, and editing entire lines
- Writing programs in SED
- Using advanced programming commands
Skill Level Intermediate
1. Sed Command-Line Basics
2. Regular Expressions
Using & and \n5m 34s
3. Sed Command-Line Flags
4. More sed Commands
5. Writing Programs in sed
Exiting with "q" and "d"3m 5s
6. Advanced Programming Concepts
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.