Operators
Arithmetic Operators
+- Plus / Addition-- Minus / Subtraction*- Multiply/- Divide==- Equal!=- Not Equal//- Floor Division<- Less Than>- Greater Than<=- Less Than or Equal To>=- Greater Than or Equal Tomod- Modulo**- Pow
Bitwise Operators
Nushell provides support for these bitwise operators:
bit-or- bitwise orbit-xor- bitwise exclusive orbit-and- bitwise andbit-shl- bitwise shift leftbit-shr- bitwise shift right
Other operators
=~/like- Regex Match / Contains!~/not-like- Not Regex Match / Not Containsin- Is a member of (doesn't use regex)not-in- Is not a member of (doesn't use regex)has- Contains a value of (doesn't use regex)not-has- Does not contain a value of (doesn't use regex)starts-with- Starts Withnot-starts-with- Does not start withends-with- Ends Withnot-ends-with- Does not end withand- Andor- Or
Brackets
[ and ]
The brackets can be used to make lists.
~> [ 1, 2, 3 ]
╭───┬───╮
│ 0 │ 1 │
│ 1 │ 2 │
│ 2 │ 3 │
╰───┴───╯{ and }
The braces can be used to make records and closures.
~> { a: 1, b: 2 }
╭───┬───╮
│ a │ 1 │
│ b │ 2 │
╰───┴───╯( and )
The parentheses can be used to denote sub-expressions.
~> # This would fail without parentheses
~> { a: ('aaa' | str length), b: 2 }
╭───┬───╮
│ a │ 3 │
│ b │ 2 │
╰───┴───╯