Open main menu

CDOT Wiki β

Changes

Tutorial11: Sed & Awk Utilities

3 bytes removed, 07:45, 6 March 2021
Using the sed Utility
'''How it Works:'''
* The sed command reads all lines in the input file and will be exposed to the expression�expression (i.e. area contained within quotes) one line at a time.
* The expression can be within single quotes or double quotes.
* The expression contains an address (match condition) and an instruction (operation).
* Can use a line number, to select a specific line (for example: 5)
* Can specify a range of line numbers (for example: 5,7)
* Can specify a regular expression to select all lines that match (e.g /^[0-9].*[0-9]$/)
* When using regular expressions, you must use forward slash(es) /
* If NO address is present, the instruction will apply to ALL lines
13,420
edits