浏览代码

sed: add {Free,Net,Open}BSD pages (#11897)

Co-authored-by: K.B.Dharun Krishna <kbdharunkrishna@gmail.com>
Vitor Henrique 1 年之前
父节点
当前提交
d5c93c019d
共有 7 个文件被更改,包括 95 次插入4 次删除
  1. 1 1
      pages.da/common/sed.md
  2. 1 1
      pages.ja/common/sed.md
  3. 1 1
      pages.ko/common/sed.md
  4. 1 1
      pages/common/sed.md
  5. 29 0
      pages/freebsd/sed.md
  6. 33 0
      pages/netbsd/sed.md
  7. 29 0
      pages/openbsd/sed.md

+ 1 - 1
pages.da/common/sed.md

@@ -1,7 +1,7 @@
 # sed
 
 > Rediger tekst, programmatisk.
-> Mere information: <https://www.gnu.org/software/sed/manual/sed.html>.
+> Mere information: <https://manned.org/man/sed.1posix>.
 
 - Erstat den første forekomst af et regulært udtryk (regular expression) i hver linje af en fil, og print resultatet:
 

+ 1 - 1
pages.ja/common/sed.md

@@ -1,7 +1,7 @@
 # sed
 
 > スクリプトによるテキスト編集。
-> 詳しくはこちら: <https://www.gnu.org/software/sed/manual/sed.html>
+> 詳しくはこちら: <https://manned.org/man/sed.1posix>
 
 - ファイルの各行で正規表現の最初の出現箇所を置換し、その結果を表示する:
 

+ 1 - 1
pages.ko/common/sed.md

@@ -2,7 +2,7 @@
 
 > 스크립트 가능한 방식으로 텍스트 편집.
 > 함께 보기: `awk`, `ed`.
-> 더 많은 정보: <https://www.gnu.org/software/sed/manual/sed.html>.
+> 더 많은 정보: <https://manned.org/man/sed.1posix>.
 
 - 모든 입력 줄에서 모든 `apple`(기본 정규식)항목을 `mango`(기본 정규식)로 바꾸고 결과를 `stdout`에 출력:
 

+ 1 - 1
pages/common/sed.md

@@ -2,7 +2,7 @@
 
 > Edit text in a scriptable manner.
 > See also: `awk`, `ed`.
-> More information: <https://www.gnu.org/software/sed/manual/sed.html>.
+> More information: <https://manned.org/man/sed.1posix>.
 
 - Replace all `apple` (basic regex) occurrences with `mango` (basic regex) in all input lines and print the result to `stdout`:
 

+ 29 - 0
pages/freebsd/sed.md

@@ -0,0 +1,29 @@
+# sed
+
+> Edit text in a scriptable manner.
+> See also: `awk`, `ed`.
+> More information: <https://www.freebsd.org/cgi/man.cgi?sed>.
+
+- 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}}`

+ 33 - 0
pages/netbsd/sed.md

@@ -0,0 +1,33 @@
+# sed
+
+> Edit text in a scriptable manner.
+> See also: `awk`, `ed`.
+> More information: <https://man.netbsd.org/sed.1>.
+
+- 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}}`

+ 29 - 0
pages/openbsd/sed.md

@@ -0,0 +1,29 @@
+# sed
+
+> Edit text in a scriptable manner.
+> See also: `awk`, `ed`.
+> More information: <https://man.openbsd.org/sed.1>.
+
+- 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}}`