From 154b25e40c982a159ee776442aa0e088a2dd649b Mon Sep 17 00:00:00 2001 From: tomit4 Date: Wed, 4 May 2022 12:33:57 -0700 Subject: [PATCH] copied table 4.2 from chapter 4: filters of unix programmer's environment book --- sed.txt | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 sed.txt diff --git a/sed.txt b/sed.txt new file mode 100644 index 00000000..e4205f50 --- /dev/null +++ b/sed.txt @@ -0,0 +1,22 @@ +----------------------------- Table 4.2 ----------------------------- + Summary of sed Commands + +a\ append lines to output until one not ending in \ +b label branch to command : label +c\ change lines to following text as in a +d delete line; read next input line +i\ insert following text before next output +l list line, making all non-printing characters visible +p print line +q quit +r file read file, copy contents to output +s/old/new/f substitute new for old. If f=g, replace all occurrences; + f=p, print; f=w file, write to file +t label test: branch to label if substitution made to current line +w file write line to file +y/str1/str2 replace each character from str1 with corresponding + character from str2 (no ranges allowed) += print current input line number +!cmd do sed cmd only if line is not selected +: label set label for b and t Commands +{ treat commands up to matching } as a group