Join David D. Levine for an in-depth discussion in this video Performing transformations with "y", part of SED Essential Training.
- SEDs y command is similar to the UNIX command tr.…It replaces single characters with other single characters.…The y command takes two strings of characters separated…by slashes as arguments, and whenever…it finds a character in the first string, it replaces it…with the corresponding character in the second string.…For example, y command will change…a-b-c-d-e and f…to their uppercase equivalents.…So the y command takes each character…from its first string and replaces it…with the corresponding character in the second string.…
This changes lowercase a-b-c-d-e and f to uppercase,…and the result looks rather like a ransom note.…Or to change the grand old Duke of York into leet speak,…you can use this.…We'll change a-c-e…i-l-o-s-t to…a-c-e-i…l-o-s-t.…So this replaces a with 4, c with parenthesis,…e with 3, i with !, l with 1,…o with 0, s to $, and t to +.…
Note that there is no way to restrict the effect…of the y command to only part of the line,…its all or nothing.…Also note that unlike tr, the y command…does not let you specify a range of characters.…
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.