Nushell
Get Nu!
Getting Started
  • The Nushell Book
  • Command Reference
  • Cookbook
  • Language Reference Guide
  • Contributing Guide
Blog
  • English
  • 中文
  • Deutsch
  • Français
  • Español
  • 日本語
  • Português do Brasil
  • Русский язык
GitHub
Get Nu!
Getting Started
  • The Nushell Book
  • Command Reference
  • Cookbook
  • Language Reference Guide
  • Contributing Guide
Blog
  • English
  • 中文
  • Deutsch
  • Français
  • Español
  • 日本語
  • Português do Brasil
  • Русский язык
GitHub
  • Categories

    • Bits
    • Bytes
    • Chart
    • Conversions
    • Core
    • Database
    • Dataframe
    • Dataframe Or Lazyframe
    • Date
    • Debug
    • Default
    • Env
    • Experimental
    • Expression
    • Filesystem
    • Filters
    • Formats
    • Generators
    • Hash
    • History
    • Lazyframe
    • Math
    • Misc
    • Network
    • Path
    • Platform
    • Plugin
    • Prompt
    • Random
    • Removed
    • Shells
    • Strings
    • System
    • Viewers

seq for generators

Output sequences of numbers.

Signature

> seq {flags} ...rest

Parameters

  • ...rest: Sequence values.

Input/output types:

inputoutput
nothinglist<number>

Examples

sequence 1 to 10

> seq 1 10
╭───┬────╮
│ 0 │  1 │
│ 1 │  2 │
│ 2 │  3 │
│ 3 │  4 │
│ 4 │  5 │
│ 5 │  6 │
│ 6 │  7 │
│ 7 │  8 │
│ 8 │  9 │
│ 9 │ 10 │
╰───┴────╯

sequence 1.0 to 2.0 by 0.1s

> seq 1.0 0.1 2.0
╭────┬──────╮
│  0 │ 1.00 │
│  1 │ 1.10 │
│  2 │ 1.20 │
│  3 │ 1.30 │
│  4 │ 1.40 │
│  5 │ 1.50 │
│  6 │ 1.60 │
│  7 │ 1.70 │
│  8 │ 1.80 │
│  9 │ 1.90 │
│ 10 │ 2.00 │
╰────┴──────╯

sequence 1 to 5, then convert to a string with a pipe separator

> seq 1 5 | str join '|'

Subcommands:

namedescriptiontype
seq charPrint a sequence of ASCII characters.built-in
seq datePrint sequences of dates.built-in