sed script files
Isolating the lines was only the first step! We still have to uncomment the lines and then save the result as a template. Although we can write this as one single sed command string, we can already see that it will be awkwardly long and difficult to read and edit. Thankfully, the sed command does have the option to read its commands from an input file, often known as a script. We use the -f option with sed to specify the file we want to read as our control.
We have already seen that we can isolate the correct lines from the file. So, the first line of the script configures the lines that we will work with. We implement the brace brackets {} to define a code block immediately after the selected lines. A code block is one or ...
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.
Read now
Unlock full access