mirror of
https://github.com/tldr-pages/tldr.git
synced 2025-04-29 23:24:55 +02:00
sed: add {Free,Net,Open}BSD pages (#11897)
Co-authored-by: K.B.Dharun Krishna <kbdharunkrishna@gmail.com>
This commit is contained in:
parent
a9f7c8fcba
commit
d5c93c019d
7 changed files with 95 additions and 4 deletions
|
@ -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,7 +1,7 @@
|
|||
# sed
|
||||
|
||||
> スクリプトによるテキスト編集。
|
||||
> 詳しくはこちら: <https://www.gnu.org/software/sed/manual/sed.html>
|
||||
> 詳しくはこちら: <https://manned.org/man/sed.1posix>
|
||||
|
||||
- ファイルの各行で正規表現の最初の出現箇所を置換し、その結果を表示する:
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
> 스크립트 가능한 방식으로 텍스트 편집.
|
||||
> 함께 보기: `awk`, `ed`.
|
||||
> 더 많은 정보: <https://www.gnu.org/software/sed/manual/sed.html>.
|
||||
> 더 많은 정보: <https://manned.org/man/sed.1posix>.
|
||||
|
||||
- 모든 입력 줄에서 모든 `apple`(기본 정규식)항목을 `mango`(기본 정규식)로 바꾸고 결과를 `stdout`에 출력:
|
||||
|
||||
|
|
|
@ -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
pages/freebsd/sed.md
Normal file
29
pages/freebsd/sed.md
Normal file
|
@ -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
pages/netbsd/sed.md
Normal file
33
pages/netbsd/sed.md
Normal file
|
@ -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
pages/openbsd/sed.md
Normal file
29
pages/openbsd/sed.md
Normal file
|
@ -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}}`
|
Loading…
Add table
Reference in a new issue