add new chinese translations

This commit is contained in:
2024-12-30 15:25:56 +08:00
parent a850046d7b
commit 0d798759fd
5418 changed files with 105800 additions and 7052 deletions

View File

@@ -1,33 +1,33 @@
# sed
> 以脚本方式编辑文本。
> 参见:`awk`, `ed`.
> 更多信息:<https://www.gnu.org/software/sed/manual/sed.html>.
> 脚本化的方式编辑文本。
> 另请参见:`awk``ed`
> 更多信息:<https://www.gnu.org/software/sed/manual/sed.html>
- 所有输入行中出现的 `apple`(基本正则语法)替换为 `mango`(基本正则语法),并将结果打印到 `stdout`
- 所有输入行中将所有 `apple`(基本正则表达式)出现的地方替换为 `mango`(基本正则表达式),并将结果打印到 `stdout`
`{{命令}} | sed 's/apple/mango/g'`
`{{command}} | sed 's/apple/mango/g'`
- 所有输入行中出现的 `apple`(扩展正则语法)替换为 `APPLE` (扩展正则语法),并将结果打印到 `stdout`
- 所有输入行中将所有 `apple`(扩展正则表达式)出现的地方替换为 `APPLE`(扩展正则表达式),并将结果打印到 `stdout`
`{{命令}} | sed -E 's/(apple)/\U\1/g'`
`{{command}} | sed -E 's/(apple)/\U\1/g'`
- `mango`(基本正则语法)替换特定文件中出现的所有 `apple`(基本正则语法),并覆盖原文件:
- 在特定文件中将所有 `apple`(基本正则表达式)出现的地方替换为 `mango`(基本正则表达式),并就地覆盖原文件:
`sed -i 's/apple/mango/g' {{路径/到/文件}}`
`sed -i 's/apple/mango/g' {{path/to/file}}`
- 执行特定脚本并将结果打印到 `stdout`
- 执行特定脚本 [f]ile 并将结果打印到 `stdout`
`{{命令}} | sed -f {{路径/到/脚本.sed}}`
`{{command}} | sed -f {{path/to/script.sed}}`
- 打印第一行到 `stdout`
- 打印第一行到 `stdout`
`{{命令}} | sed -n '1p'`
`{{command}} | sed -n '1p'`
- 删除文件第一行:
- [d]elete 文件第一行:
`sed -i 1d {{路径/到/文件}}`
`sed -i 1d {{path/to/file}}`
- 插入新行到文件的第一行:
- [i]nsert 在文件的第一行插入新行
`sed -i '1i\your new line text\' {{路径/到/文件}}`
`sed -i '1i\your new line text\' {{path/to/file}}`