diff --git a/pages.da/common/sed.md b/pages.da/common/sed.md index a3c496ad80..98319014b5 100644 --- a/pages.da/common/sed.md +++ b/pages.da/common/sed.md @@ -1,7 +1,7 @@ # sed > Rediger tekst, programmatisk. -> Mere information: . +> Mere information: . - Erstat den første forekomst af et regulært udtryk (regular expression) i hver linje af en fil, og print resultatet: diff --git a/pages.ja/common/sed.md b/pages.ja/common/sed.md index 965724225b..3114c76d77 100644 --- a/pages.ja/common/sed.md +++ b/pages.ja/common/sed.md @@ -1,7 +1,7 @@ # sed > スクリプトによるテキスト編集。 -> 詳しくはこちら: +> 詳しくはこちら: - ファイルの各行で正規表現の最初の出現箇所を置換し、その結果を表示する: diff --git a/pages.ko/common/sed.md b/pages.ko/common/sed.md index ebfd5f4c57..50d7cb9911 100644 --- a/pages.ko/common/sed.md +++ b/pages.ko/common/sed.md @@ -2,7 +2,7 @@ > 스크립트 가능한 방식으로 텍스트 편집. > 함께 보기: `awk`, `ed`. -> 더 많은 정보: . +> 더 많은 정보: . - 모든 입력 줄에서 모든 `apple`(기본 정규식)항목을 `mango`(기본 정규식)로 바꾸고 결과를 `stdout`에 출력: diff --git a/pages/common/sed.md b/pages/common/sed.md index 71119363be..f39b712b81 100644 --- a/pages/common/sed.md +++ b/pages/common/sed.md @@ -2,7 +2,7 @@ > Edit text in a scriptable manner. > See also: `awk`, `ed`. -> More information: . +> More information: . - Replace all `apple` (basic regex) occurrences with `mango` (basic regex) in all input lines and print the result to `stdout`: diff --git a/pages/freebsd/sed.md b/pages/freebsd/sed.md new file mode 100644 index 0000000000..6b37834de5 --- /dev/null +++ b/pages/freebsd/sed.md @@ -0,0 +1,29 @@ +# sed + +> Edit text in a scriptable manner. +> See also: `awk`, `ed`. +> More information: . + +- Replace all `apple` (basic regex) occurrences with `mango` (basic regex) in all input lines and print the result to `stdout`: + +`{{command}} | sed 's/apple/mango/g'` + +- Execute a specific script [f]ile and print the result to `stdout`: + +`{{command}} | sed -f {{path/to/script.sed}}` + +- Delay opening each file until a command containing the related `w` function or flag is applied to a line of input: + +`{{command}} | sed -fa {{path/to/script.sed}}` + +- Replace all `apple` (extended regex) occurrences with `APPLE` (extended regex) in all input lines and print the result to `stdout`: + +`{{command}} | sed -E 's/(apple)/\U\1/g'` + +- Print just a first line to `stdout`: + +`{{command}} | sed -n '1p'` + +- Replace all `apple` (basic regex) occurrences with `mango` (basic regex) in a specific file and overwrite the original file in place: + +`sed -i 's/apple/mango/g' {{path/to/file}}` diff --git a/pages/netbsd/sed.md b/pages/netbsd/sed.md new file mode 100644 index 0000000000..7f3e75b7dc --- /dev/null +++ b/pages/netbsd/sed.md @@ -0,0 +1,33 @@ +# sed + +> Edit text in a scriptable manner. +> See also: `awk`, `ed`. +> More information: . + +- Replace all `apple` (basic regex) occurrences with `mango` (basic regex) in all input lines and print the result to `stdout`: + +`{{command}} | sed 's/apple/mango/g'` + +- Execute a specific script [f]ile and print the result to `stdout`: + +`{{command}} | sed -f {{path/to/script.sed}}` + +- Delay opening each file until a command containing the related `w` function or flag is applied to a line of input: + +`{{command}} | sed -fa {{path/to/script.sed}}` + +- Turn on GNU re[g]ex extension: + +`{{command}} | sed -fg {{path/to/script.sed}}` + +- Replace all `apple` (extended regex) occurrences with `APPLE` (extended regex) in all input lines and print the result to `stdout`: + +`{{command}} | sed -E 's/(apple)/\U\1/g'` + +- Print just a first line to `stdout`: + +`{{command}} | sed -n '1p'` + +- Replace all `apple` (basic regex) occurrences with `mango` (basic regex) in a specific file and overwrite the original file in place: + +`sed -i 's/apple/mango/g' {{path/to/file}}` diff --git a/pages/openbsd/sed.md b/pages/openbsd/sed.md new file mode 100644 index 0000000000..76c8da562c --- /dev/null +++ b/pages/openbsd/sed.md @@ -0,0 +1,29 @@ +# sed + +> Edit text in a scriptable manner. +> See also: `awk`, `ed`. +> More information: . + +- Replace all `apple` (basic regex) occurrences with `mango` (basic regex) in all input lines and print the result to `stdout`: + +`{{command}} | sed 's/apple/mango/g'` + +- Execute a specific script [f]ile and print the result to `stdout`: + +`{{command}} | sed -f {{path/to/script.sed}}` + +- Delay opening each file until a command containing the related `w` function or flag is applied to a line of input: + +`{{command}} | sed -fa {{path/to/script.sed}}` + +- Replace all `apple` (extended regex) occurrences with `APPLE` (extended regex) in all input lines and print the result to `stdout`: + +`{{command}} | sed -E 's/(apple)/\U\1/g'` + +- Print just a first line to `stdout`: + +`{{command}} | sed -n '1p'` + +- Replace all `apple` (basic regex) occurrences with `mango` (basic regex) in a specific file and overwrite the original file in place: + +`sed -i 's/apple/mango/g' {{path/to/file}}`