2022-02-14 03:22:51 +01:00
|
|
|
---
|
|
|
|
title: seq
|
|
|
|
layout: command
|
|
|
|
version: 0.59.0
|
|
|
|
---
|
|
|
|
|
2021-05-30 02:57:04 +02:00
|
|
|
Print sequences of numbers.
|
|
|
|
|
2022-02-14 03:22:51 +01:00
|
|
|
## Signature
|
2021-05-30 02:57:04 +02:00
|
|
|
|
2022-02-14 03:22:51 +01:00
|
|
|
```> seq ...rest --separator --terminator --widths```
|
2021-05-30 02:57:04 +02:00
|
|
|
|
|
|
|
## Parameters
|
|
|
|
|
2022-02-14 03:22:51 +01:00
|
|
|
- `...rest`: sequence values
|
|
|
|
- `--separator {string}`: separator character (defaults to \n)
|
|
|
|
- `--terminator {string}`: terminator character (defaults to \n)
|
|
|
|
- `--widths`: equalize widths of all numbers by padding with zeros
|
2021-05-30 02:57:04 +02:00
|
|
|
|
|
|
|
## Examples
|
2022-02-14 03:22:51 +01:00
|
|
|
|
|
|
|
sequence 1 to 10 with newline separator
|
2021-05-30 02:57:04 +02:00
|
|
|
```shell
|
|
|
|
> seq 1 10
|
2022-02-14 03:22:51 +01:00
|
|
|
```
|
2021-05-30 02:57:04 +02:00
|
|
|
|
2022-02-14 03:22:51 +01:00
|
|
|
sequence 1.0 to 2.0 by 0.1s with newline separator
|
2021-05-30 02:57:04 +02:00
|
|
|
```shell
|
|
|
|
> seq 1.0 0.1 2.0
|
2022-02-14 03:22:51 +01:00
|
|
|
```
|
2021-05-30 02:57:04 +02:00
|
|
|
|
2022-02-14 03:22:51 +01:00
|
|
|
sequence 1 to 10 with pipe separator
|
2021-05-30 02:57:04 +02:00
|
|
|
```shell
|
|
|
|
> seq -s '|' 1 10
|
2022-02-14 03:22:51 +01:00
|
|
|
```
|
2021-05-30 02:57:04 +02:00
|
|
|
|
2022-02-14 03:22:51 +01:00
|
|
|
sequence 1 to 10 with pipe separator padded with 0
|
2021-05-30 02:57:04 +02:00
|
|
|
```shell
|
|
|
|
> seq -s '|' -w 1 10
|
2022-02-14 03:22:51 +01:00
|
|
|
```
|
2021-05-30 02:57:04 +02:00
|
|
|
|
2022-02-14 03:22:51 +01:00
|
|
|
sequence 1 to 10 with pipe separator padded by 2s
|
2021-05-30 02:57:04 +02:00
|
|
|
```shell
|
|
|
|
> seq -s ' | ' -w 1 2 10
|
2022-02-14 03:22:51 +01:00
|
|
|
```
|
2021-05-30 02:57:04 +02:00
|
|
|
|