Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions book/operators.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,17 @@ Nushell supports the following operators for common math, logic, and string oper
| `in` | value in list |
| `not-in` | value not in list |
| `not` | logical not |
| `&&`, `and` | and two Boolean values |
| `\|\|`, `or`| or two Boolean values |
| `fdiv` | floor division |
| `**` | pow |
| `bit-or` | bitwise or |
| `bit-xor` | bitwise xor |
| `bit-and` | bitwise and |
| `bit-shl` | bitwise shift left |
| `bit-shr` | bitwise shift right |
| `starts-with` | string starts with |
| `ends-with` | string ends with |
| `&&`, `and` | and two Boolean values |
| `\|\|`, `or` | or two Boolean values |
| `//` | floor division |
| `**` | pow |
| `bit-or` | bitwise or |
| `bit-xor` | bitwise xor |
| `bit-and` | bitwise and |
| `bit-shl` | bitwise shift left |
| `bit-shr` | bitwise shift right |
| `starts-with` | string starts with |
| `ends-with` | string ends with |

Parentheses can be used for grouping to specify evaluation order or for calling commands and using the results in an expression.

Expand Down
10 changes: 5 additions & 5 deletions i18n-meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@
{
"name": "nushell_map.md",
"en": "Completed",
"zh-CN": "ae23eeba3@hustcer",
"zh-CN": "61bb68454f@hustcer",
"de": "-",
"tr": "-",
"ja": "-",
Expand Down Expand Up @@ -242,7 +242,7 @@
{
"name": "operators.md",
"en": "Completed",
"zh-CN": "51522d5591@hustcer",
"zh-CN": "61bb68454f@hustcer",
"de": "-",
"tr": "-",
"ja": "-",
Expand Down Expand Up @@ -332,7 +332,7 @@
{
"name": "table_of_contents.md",
"en": "Completed",
"zh-CN": "fa90895307@hustcer",
"zh-CN": "61bb68454f@hustcer",
"de": "-",
"tr": "-",
"ja": "-",
Expand All @@ -352,7 +352,7 @@
{
"name": "types_of_data.md",
"en": "Completed",
"zh-CN": "d6efb9a35a@hustcer",
"zh-CN": "61bb68454f@hustcer",
"de": "-",
"tr": "-",
"ja": "-",
Expand All @@ -362,7 +362,7 @@
{
"name": "variables_and_subexpressions.md",
"en": "Completed",
"zh-CN": "0b0389f2c@hustcer",
"zh-CN": "61bb68454f@hustcer",
"de": "translated by @sebastian-xyz",
"tr": "-",
"ja": "-",
Expand Down
2 changes: 1 addition & 1 deletion zh-CN/book/nushell_map.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
| clear | - | - | Clear-Host | clear |
| compact | | | | |
| config | - | - | $Profile | vi .bashrc, .profile |
| count | count | Count | Measure-Object, measure | wc |
| cp | - | - | Copy-Item, cp, copy | cp |
| date | NOW() / getdate() | DateTime class | Get-Date | date |
| debug | | | | |
Expand Down Expand Up @@ -45,6 +44,7 @@
| keep-while | | TakeWhile | | |
| kill | - | - | Stop-Process, kill | kill |
| last | | Last, LastOrDefault | Select-Object -Last | tail |
| length | count | Count | Measure-Object, measure | wc |
| lines | - | - | File.ReadAllLines | |
| ls | - | - | Get-ChildItem, dir, ls | ls |
| match(`*`) | case when | Regex.IsMatch | [regex] | |
Expand Down
9 changes: 9 additions & 0 deletions zh-CN/book/operators.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,15 @@ Nushell 支持以下常见的数学、逻辑和字符串操作的运算符:
| `not` | 逻辑取反 |
| `&&`, `and` | 两个布尔值与运算 |
| `\|\|`, `or` | 两个布尔值或运算 |
| `//` | 向下取整整除 |
| `**` | 幂运算 |
| `bit-or` | 按位或 |
| `bit-xor` | 按位异或 |
| `bit-and` | 按位与 |
| `bit-shl` | 按位左移 |
| `bit-shr` | 按位右移 |
| `starts-with` | 字符串开始检测 |
| `ends-with` | 字符串结尾检测 |

圆括号可用于分组以指定求值顺序,或用于调用命令并在表达式中使用结果。

Expand Down
1 change: 1 addition & 0 deletions zh-CN/book/table_of_contents.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
- [环境变量](environment.md) - 使用环境变量
- [标准输出、错误和退出码](stdout_stderr_exit_codes.md) - 使用标准输出、错误和退出码
- [模块](modules.md) - 创建和使用你自己的模块
- [钩子](hooks.md) - 添加自动运行的代码片断
- [脚本](scripts.md) - 创建你自己的脚本
- [元数据](metadata.md) - 细说 Nushell 的元数据系统
- [创建你自己的`错误`](creating_errors.md) - 创建你自己的错误信息
Expand Down
6 changes: 6 additions & 0 deletions zh-CN/book/types_of_data.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ Nu 在其命令中采用了这种方法,并将其扩展到包括其他类型

像许多编程语言一样,Nu 使用一组简单和结构化的数据类型对数据进行建模。简单的数据类型包括整数、浮点数、字符串、布尔、日期和路径。它还包括一个用于表示文件大小的特殊类型。

你可以通过 [`describe`](/book/commands/describe.md) 命令获取一个值的类型:

```
> 42 | describe
```

## 整数

整数(或整形)数字:例子包括 1、5 和 100。
Expand Down
2 changes: 1 addition & 1 deletion zh-CN/book/variables_and_subexpressions.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ Nushell 支持使用一种简化的方式访问子表达式中的列,你可能
```bash
> ls | where $it.size > 10kb
> ls | where ($it.size > 10kb)
> ls | where {|$it| $it.size > 10kb }
> ls | where {|$x| $x.size > 10kb }
```

为了使简化语法正常工作,列名必须出现在操作的左侧(如`size > 10kb`中的`size`)。